After reading the unlimited category of the moderator and dividing it into a tree structure, how can I restore the original array of the unlimited category of the parent and child ;? * Obtain the wireless category and arrange the node paths of the wireless category * $ aarray & nbsp; (& nbsp; 0 & nbsp; & gt; & nbsp; array & nbsp; (& nbsp; id & nbsp; & gt; & nbsp; 134, & nb read the unlimited category of the moderator, how to restore a tree structure
Unlimited parent-child category
Original array
/*
Obtain the wireless classification and arrange the node paths of the wireless classification.
*/
$ A = array (
0 =>
Array (
'Id' => '123 ',
'Fid' => '0 ',
'Name' => 'T ',
),
1 =>
Array (
'Id' => '123 ',
'Fid' => '0 ',
'Name' => 'K ',
),
2 =>
Array (
'Id' => '123 ',
'Fid' => '0 ',
'Name' => 'J ',
),
3 =>
Array (
'Id' => '123 ',
'Fid' => '123 ',
'Name' => 'I am k's classification 1 ',
),
4 =>
Array (
'Id' => '123 ',
'Fid' => '123 ',
'Name' => 'I Am t's classification t2 ',
),
5 =>
Array (
'Id' => '123 ',
'Fid' => '123 ',
'Name' => 'My name is t's classification T1 ',
),
6 =>
Array (
'Id' => '123 ',
'Fid' => '123 ',
'Name' => 'I am k classification 1-1 ',
),
7 =>
Array (
'Id' => '123 ',
'Fid' => '123 ',
'Name' => 'I am a k classification 1-1-1 ',
),
8 =>
Array (
'Id' => '123 ',
'Fid' => '123 ',
'Name' => 'I am a k classification 1-1-1-1 ',
),
)
?>
Start to form a tree and add a path. the tree array is $ trees.
Array
(
[0] => Array
(
[Id] = & gt; 134
[Fid] => 0
[Name] => t
[Path] = & gt; 134
[_ Sub] => Array
(
[0] => Array
(
[Id] = & gt; 136
[Fid] = & gt; 134
[Name] => I am a t2-class T2.
[Path] = & gt; 134,136
)
[1] => Array
(
[Id] = & gt; 135
[Fid] = & gt; 134
[Name] => I am a T'S class t1
[Path] = & gt; 134,135
)
)
)
[1] => Array
(