Skip to content
Advertisement

PHP – find value in array 3D

I have data something like this:

JavaScript

so, if I search by “age”, the result is array("1"=>"5321")

if I search by “gender”, the result is array("1"=>"5321", "2"=>"3213", "3"=>"4444")

basically I want to find who has specific value in php, I need a hand to solve this.

Thanks for your time 🙂

EDIT, here’s my snip:

JavaScript

Advertisement

Answer

Your search value is one level below with index 0. In my code this is $subArr[0].

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement