in array check 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: php value in array
in_array ( mixed $needle , array $haystack , bool $strict = false ) : bool