View Single Post
  #3  
Old 10-04-2011, 09:10 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Additional Information:

haystack.pos(needle) will return the position of needle in the haystack (string/variable).

Also since arrays are treated like strings, it can be used as a quick method to search an array as well, for arrays there's also haystack.index(needle).

Examples:

PHP Code:
function onCreated() {
  
// Position Example
  
temp.str "hello world";
  echo(
temp.str.pos("world")); // will echo 
  // Index Example
  
temp.fruits = {
    
"apple""orange""grapes"
  
};
  echo(
temp.fruits.index("orange"));

__________________
Quote:
Reply With Quote