How to check element exists in array using php in_array() method


PHP in_array() method are use for find element in array . in_array method() receive two parameter . first element name and second parameter also an array variable . most remember thing in_array method search element in also indexed array not other.

<?php 
$arr = ['php' , 'html' , 'ajax' , 'jquery' , 'javascript' , 'laravel' , 'codeignitor'];
if(in_array('html' , $arr)){
   echo "Element found !!!";
}
else{
   echo "Element not found !!!";
}
?>
Output : Element found !!!