I have the below array and trying to get the value of the key named 'Summary' from $array variable.
["Rows"]=>
array(1) {
["Row"]=>
array(1) {
[0]=>
array(1) {
["Rows"]=>
array(1) {
["Row"]=>
array(1) {
[0]=>
array(1) {
["Rows"]=>
array(1) {
["Row"]=>
array(1) {
[0]=>
array(1) {
["Summary"]=>
array(1) {
["ColData"]=>
array(2) {
[0]=>
array(1) {
["value"]=>
string(19) "Some Value"
}
[1]=>
array(1) {
["value"]=>
string(7) "2001.00"
}
}
}
}
}
}
}
}
}
}
}
}
I have tried following,
array_map(function ($ar) {return $ar['Summary'];}, $array);
But didn't get success.
What am I doing wrong?
array_mapwill not go deeper than first level, that's allarray_walk_recursive, i'd give you a snippet if i had time but check out these answersarray_walk_recursive()will only iterate the "leaf-nodes" of the array, it will not work for this case.