How to get the value of a column in a multidimensional array?

[
    "id" => 7
    "parent_id" => 9
    "child_id" => 11
    "children" => [
      0 =>  [
        "id" => 4,
        "parent_id" => 11,
        "child_id" => 2
      ]
      1 =>  [
        "id" => 5,
        "parent_id" => 11,
        "child_id" => 3
      ]
      2 =>  [
        "id" => 6,
        "parent_id" => 11,
        "child_id" => 4
      ]
    ]
  ]
  1 =>  [
    "id" => 8,
    "parent_id" => 10,
    "child_id" => 11
    "children" => [
      0 =>  [
        "id" => 4,
        "parent_id" => 11,
        "child_id" => 2
      ]
      1 =>  [
        "id" => 5,
        "parent_id" => 11,
        "child_id" => 3
      ]
      2 =>  [
        "id" => 6,
        "parent_id" => 11,
        "child_id" => 4
      ]
    ]
  ]

the generation rules are as follows
the child_id under parent_id- > child_id- > children of each object is an array
above the result is

[[9,11,2,3,4],[10,11,2,3,4]]
Php
Apr.05,2021

$arr = [
  [
    "id" => 7,
    "parent_id" => 9,
    "child_id" => 11,
    "children" => [
      [
        "id" => 4,
        "parent_id" => 11,
        "child_id" => 2
      ],
      [
        "id" => 5,
        "parent_id" => 11,
        "child_id" => 3]
      ,
      [
        "id" => 6,
        "parent_id" => 11,
        "child_id" => 4
      ]
    ]
  ],
  [
    "id" => 8,
    "parent_id" => 10,
    "child_id" => 11,
    "children" => [
      [
        "id" => 4,
        "parent_id" => 11,
        "child_id" => 2
      ], [
        "id" => 5,
        "parent_id" => 11,
        "child_id" => 3
      ], [
        "id" => 6,
        "parent_id" => 11,
        "child_id" => 4
      ]
    ]
  ]
];

$result = array_map(function ($item) {
  return array_merge([$item['parent_id'], $item['child_id']], array_map(function ($item) {
    return $item['child_id'];
  }, $item['children']));
}, $arr);

print_r($result);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf98b4-31907.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf98b4-31907.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?