HOW to check values are present in an Array?

There are various scenarios in which you want to check whether the given value is present in array or not.

So, here’s the simple PHP function which we can use to check.

PHP

Output of above code will be Available

Now, what if we want to check whether multiple values present in an array or not.

PHP

If we want to check whether all fruits from $search array is present in $fruits, then we need to run following code

PHP

But, if want to check any of the fruits are available in an array, then

PHP

Hope, this will be useful