> What I was  looking for was finding out what was the index of thet
> value, lets say I have a array with some values like (23, 56, 45, 47)
> and i don't know where the walue I'm looking for is indexed in the array
> and I want to find out what the indexnumber is, how would that be
> possable


function array_index($array,$needle)
/* written by [EMAIL PROTECTED] */
foreach($array as $key=>$value)
return $key;
return -1;

$array=array(23, 56, 45, 47);

echo array_index($array,45);
echo array_index($array,48);
if(array_index($array,48)<0)echo 'not found';
else echo 'found';

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to