array_search
| From: | Steen Rabol | Date: | Wed, 20 Jun 2001 06:41:50 +0000 |
| Subject: | array_search | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-54460@lists.php.net to get a copy of this message | ||
Hi
How to figure out of a value is found using array_search ?
eg:
$myarray = array("val1","val2","val3");
if(array_search("val2",$myarray))
{
print "Value found";
}
the above will work, but...
if(array_search("val1",$myarray))
{
print "Value found";
}
the above will not work as "val1" is key 0, how can I solve this ?
Thanks in advance
Steen