How to filter multi-dimensional array (with more than two levels) by value?
问题 Assuming the following three-dimensional array is given: Array ( [0] => Array ( [0] => Array ( [foo] => bar ) [1] => Array ( [foo] => bar2 ) [2] => Array ( [foo] => bar3 ) ) [1] => Array ( [0] => Array ( [foo] => baz ) [1] => Array ( [foo] => bar ) [2] => Array ( [foo] => bar5 ) ) ) Now I need to filter it. If [foo] is not equal to bar the corresponding inner array should get removed. The result would be: Array ( [0] => Array ( [0] => Array ( [foo] => bar ) ) [1] => Array ( [1] => Array (