I use in_array() to check whether a value exists in an array like below,
in_array()
$a = array(\"Mac\", \"NT\", \"Irix\", \"Linux\"); if (in_array(\"Irix\"
what about array_search? seems it quite faster than foreach according to https://gist.github.com/Ocramius/1290076 ..
if( array_search("Irix", $a) === true) { echo "Got Irix"; }