Skip to content Skip to sidebar Skip to footer

PHP find elements in an array

Reading Time: < 1 minute

How can I find elements in an array using php.Here is a simple small example to find element an array.Youcan use php in_array() function to this.

 'user_id', 1 => 'user_name', 2 => 'user_email');
$result = in_array('user_id',$myArray);
if($result)
	echo "Exist";
else
	echo "Doesn't Exist";
?>