On Friday 26 April 2002 00:30, andy wrote:
> Hi there,
>
> I am passing an array through the URL with a ',' inbetween:
> var=php,mysql,super
> Parsing is done with: explode (',',$var). This gives me an array starting
> with 0
>
> Later on I have to search for lets say php with array_search.
>
> Unfortunatelly array_search requires an array starting with 1. So php is
> not found.

Haven't used this function before, but where does it say anything about 
requiring an array starting with 1? Did you try it anyway?

> Does anybody know a workaround for this?

You can do:

$my_array = array_flip($my_array)
$key = $my_array['search_item'];

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"Conversion, fastidious Goddess, loves blood better than brick, and feasts
most subtly on the human will."
-- Virginia Woolf, "Mrs. Dalloway"
*/

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

Reply via email to