私はこの配列を内破しようとしています:
$name;
foreach ($childs as $cval) {
$name[] = $cval;
}
そして、ここに私が得たものがあります:
Array
(
[0] => Array
(
[0] => Array
(
[pages_name] => services child 1
)
[1] => Array
(
[pages_name] => services child 2
)
)
[1] => Array
(
[0] => Array
(
[pages_name] => inner service child 1
)
[1] => Array
(
[pages_name] => inner service child 2
)
)
[2] => Array
(
[0] => Array
(
[pages_name] => gallery child 1
)
[1] => Array
(
[pages_name] => gallery child 2
)
)
)
私はこれをarray_map
次のようにやっています:
$arr = array_map(function($el){ return $el['pages_name']; }, $name);
$str = implode(',', $arr);
そして、私はこのエラーを受け取りました:
Undefined index: pages_name