in_array — Checks if a value exists in an array
bool in_array ( mixed
$needle
, array $haystack
[, bool $strict
= FALSE
] )Example #1 in_array() example
<?php
$os = array("Mac", "NT", "Irix", "Linux");
if (in_array("Irix", $os)) {
echo "Got Irix";
}
if (in_array("mac", $os)) {
echo "Got mac";
}?>
No comments:
Post a Comment