Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: ARRAYS; GETTING ELEMENT NUMBER  (Read 795 times)

0 Members and 1 Guest are viewing this topic.

Offline ZNorQ

  • Members
  • *
  • ehr... uhm... duh...
ARRAYS; GETTING ELEMENT NUMBER
« on: 16 May 2004, 20:27:32 »
Hey,

The "In" function is nice for checking for a specific element in an array - but how can I get the position number of an element in an array?

Example;

["Cake", "Coffee", "Bread", "Milk"]

Lets say I want the position number for "Bread". I know I can use
"Bread" in ["Cake", "Coffee", "Bread", "Milk"] to find out that it exists...

What would be nice is if "in" returned the position if it existed, instead
of a boolean result.

Anyone?

ZNorQ

Offline ZNorQ

  • Members
  • *
  • ehr... uhm... duh...
Re:ARRAYS; GETTING ELEMENT NUMBER
« Reply #1 on: 16 May 2004, 20:39:08 »
Forget it ppl! Found a function (indexOf)..! He who looks, finds... maybe..

ZNorQ