chekc if a value is in array php code example
Example 1: php in array
$colors = array("red", "blue", "green");
if (in_array("red", $colors)) {
echo "found red in array";
}
Example 2: in_array
in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] ) : bool