php in_array – Best 3 Ways To Check If a Value Exists in an Array in PHP?

Today, We want to share with you php in_array.In this post we will show you php in array key value, hear for php in array multidimensional we will give you demo and example for implement.In this post, we will learn about PHP Check If Multiple Array Contains All Array with an example.

php in_array

Example 1 : PHP Function

<!DOCTYPE html>

$members = array("Virat", "Jagruti", "Geeta", "Chandni");

if (in_array("Geeta", $members))
  echo "Good Luck, Match found";
  echo "Sorry, Match not found";


Example 2

Simple PHP in_array() function examples


$members = [

$result = in_array('bhavik', $members);

var_dump($result); // bool(true)

Example 3

Using PHP in_array() function with the strict comparison example


$member_ids = [14, '45', '47', 88];

$result = in_array(45, $member_ids);

var_dump($result); //  bool(true)

I hope you get an idea about php array.
I would like to have feedback on my
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, donโ€™t forget to share.