Hello friends, welcome to my another blog post check multiple value exists in array using PHP. In my anothertutorial I show you how to check value exists in array php. But that code does not allow to check multiple value exists in array. But if you want to check multiple values exists in an array then what to do. There is a multiple options for you. You can create your own function, search in google or use my function. In this post I will create a custom function my_custom_function which will do the trick for you.

Here is my function:



Here array_intersect() function compare the values of two arrays, and returns an array containing all of the values in array1 (here search array) whose values exist in all of the parameters and that matches count should be equal to the $search array items count. If both are equal it will return true otherwise it will return false.

Below I give two examples for you to understand what the function exactly do.

So now you learn how to check multiple value exists in array using PHP. If you like my post please share it with your friends.

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Check multiple value exists in array PHP
Tagged on: