Reply content:
should be their own splicing, probably the following way
$arr = [0=> [' id ' = ' 1 ', ' title ' = ' Total column ', ' Children ' =>[0=>[' id ' = ' 4 ', ' title ' ' + ' interview ', ' Children ' =>[]], 1=>[' id ' = ' 5 ', ' title ' = ' announcement ', ' children ' =>[]], 1 = [' id ' = ' 3 ', ' title ' = ' Total theme ', ' Children ' =>[0=>[' id ' = ' 6 ', ' title ' + ' Sateri card on it ', ' children ' =>[]], 1=>[' id ' = ', ' title ' = ' Chicken jelly ', ' children ' =>[0=> [' id ' = ' 7 ', ' title ' = ' Love life ', ' children ' =>[]], 1=>[' id ' = ' 8 ', ' title ' = ' Reduced productivity pride ', ' CHI Ldren ' =>[0=>[' id ' = ' 9 ', ' title ' = ' big ', ' children ' =>[]] ] ], ] ]]; $returnInfo = Getselectarray ($arr); Var_dump ($returnInfo);p ublic function Getselectarray ($arr, $grade = 0) {$char = [', ' ├ ', ' |├ ', ' | ├ ']; $encChar = [' ', ' ┕ ', ' |┕ ', ' | ┕ ']; $retuRninfo = []; foreach ($arr as $key = + $val) {$sort = $key + 1; $tmp [' id '] = $val [' id ']; if ($val = = End ($arr)) {$tmp [' title '] = $encChar [$grade]. $val [' title ']; } else {$tmp [' title '] = $char [$grade]. $val [' title ']; } $children = Getselectarray ($val [' Children '], $grade + 1); $returnInfo [] = $tmp; $returnInfo = Array_merge ($returnInfo, $children); } return $returnInfo; }