I need to search a multidimensional array for a specific value in any of the indexed subarrays.
In other words, I need to check a single column of the multidimension
I came upon this post looking to do the same and came up with my own solution I wanted to offer for future visitors of this page (and to see if doing this way presents any problems I had not forseen).
If you want to get a simple true
or false
output and want to do this with one line of code without a function or a loop you could serialize the array and then use stripos
to search for the value:
stripos(serialize($my_array),$needle)
It seems to work for me.