<?php $os = array("Mac", "NT", "Irix", "Linux"); if (in_array("Irix", $os)) { echo "Got Irix"; } if (in_array("mac", $os)) { echo "Got mac"; } ?>
<?php $people = array("Peter", "Joe", "Glenn", "Cleveland"); if (in_array("Glenn", $people)) { echo "Match found"; } else { echo "Match not found"; } ?>
<?php /** in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] ) : bool */ $os = array("Mac", "NT", "Irix", "Linux"); if (in_array("Irix", $os)) { echo "Got Irix"; } if (in_array("mac", $os)) { echo "Got mac"; } ?>
<? in_array("Irix", $os); ?>
in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] ) : bool
in_array(search, array, type)