This is my array
Array (
[camp] => 1523270715437137241
[seg] => Array
([0] => Array
( [id] => 1524043028577447661
[ben] => 10000
[rule] => Array
([0] => Array
([id] => 1524050160515158364
[logic] => #3 and # 4
)))))
I want to get the values belongs to 'rule' array which is inside three big arrays without using foreach loop. Is it possible?
foreach( $array['seg'] as $key => $data) print_r($data['rule']);array_column(). Iterating is still iterating, I can't see the bias against a looping language contructs. I love a well-placedarray_column()call, but it is usually a heavier weapon than aforeach(). The only other hackish way that I can think of would be convert to json, then write some horrible regular expression to isolate the subarray and then decode it back to an array ... yuck.