Is it possible to search an array for a value? I've looked through the manual, but I couldn't find anything... Anyone knows how to do?
ive never actually use arrays much until a task im doing which in away requires arrays.
Ok ive never actually used it. But i think its what you are needing array_search
http://www.php.net/manual/en/function.array-search.php
PHP manual set out mixed array_search ( mixed needle, array haystack [, bool strict])
or [MAN]in_array[/MAN]
$os = array ("Mac", "NT", "Irix", "Linux"); if (in_array ("Irix", $os)) { print "Got Irix"; } if (in_array ("mac", $os)) { print "Got mac"; }
Thank you very much! That helped!
bernouli after i posted that post. I saw in_array(); i think both are good. But it depends on the situation
But it depends on the situation
nice Argument
i finally decided to use [man]in_array[/man], since that one worked best for this script! Thanks!