submitted by: Guest
PHP: search array - find in array
Search an array to find a specific value.
code snippet:
<?php
$os = array("Mac", "NT", "Irix", "Linux");
if (in_array("Irix", $os)) {
echo "Got Irix";
}
if (in_array("mac", $os)) {
echo "Got mac";
}
?>
sample output:
Got Irix
notes:
This example directly from the PHP documentation site.



