|
Posted by Renι Fournier on 11/09/28 11:19
I need to search an array for a string, with a twist. E.g.:
$array = array(0 => 'this sky is blue', 1 => 'pencils are orange', 2 =>
'I like green apples', 3 => 'strawberries are red');
$key = array_search('green', $array);
With the above code, nothing will be returned, but I would like it to
return 2 for the key containing "green". Any suggestions?
....RenΓ©
[Back to original message]
|