in_array :php find in array

PHP in_array is used to check if a value exists in an array


Syntax:
bool in_array($var,$arr)

Returns TRUE if $var exists in an array, FALSE otherwise.

Example:php find in array
<?php
$arr1 = array('A','B');
if(in_array('A',$arr1))
echo '`A` exists in an array' 
else 
echo 'Not Found';
?>


Output :
Array.