Search key value pair in multidimensional array

How to search key value pair in multidimensional array? In other words search for subset of multidimensional, multilevel array by key and value pair.

This is solution to this problem, notice that in $arr[1] there is multidimensional array, and is also returned in output of search.

output of print_r :

BTW as you can see in first code snippet, it do not include closing ?> tag. As you can know closing PHP tag is optional. And if do not necessary you can and should not include it. This is because after closing PHP tag there could be empty¬†white space¬†character that will make problems with sessions. Ie. “headers already send” type of errors.


Leave a Reply

Your email address will not be published. Required fields are marked *