can do this:
$array = array('apple', 'pear', 'orange', 'apricot');
$array = array_flip($array);
$keyword = 'orange';
echo "found '$orange' @ index:" . $array[$keyword];
Don't use this method though! It makes your program slow!
"Tim Fountain" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This may be a silly question, but I'm used to being able to find PHP
> functions to do whatever I want, but I can't find one to do this!
> If I have an array like this:
>  -> 'apple';
>  -> 'pear';
>  -> 'orange';
>  -> 'apricot';
> I know I can use in_array() to check whether, say, 'orange' is in the
> array; but how do I then find out which index 'orange' is at?
> Tim Fountain ([EMAIL PROTECTED])
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php