The in_array() function searches an array for a specific value.
Syntax
in_array(search,array,type)
Example
<?php
$people = array("Peter", "Joe", "Glenn", "Cleveland");
if (in_array("Glenn", $people))
{
echo "Match found";
}
else
{
echo "Match not found";
}
?>