怎么将一个树状数组转换为一个普通的二维数组
程序员文章站
2022-05-10 09:58:20
...
如何将一个树状数组转换为一个普通的二维数组
请教如何将一个树状数组转换为一个普通的二维数组
元素的顺序不要紧~~只要是这个结构就行了
例如
Array
(
[0] => Array
(
[kind_id] => 1103
[kind_fid] => 1101
[kind_name] => asdfsadf
[children] => Array
(
[0] => Array
(
[kind_id] => 1109
[kind_fid] => 1103
[kind_name] => testt
[children] => Array
(
)
)
)
)
[1] => Array
(
[kind_id] => 1104
[kind_fid] => 1101
[kind_name] => sdfsdf
[children] => Array
(
[0] => Array
(
[kind_id] => 1110
[kind_fid] => 1104
[kind_name] => test222
请教如何将一个树状数组转换为一个普通的二维数组
元素的顺序不要紧~~只要是这个结构就行了
例如
Array
(
[0] => Array
(
[kind_id] => 1103
[kind_fid] => 1101
[kind_name] => asdfsadf
[children] => Array
(
[0] => Array
(
[kind_id] => 1109
[kind_fid] => 1103
[kind_name] => testt
[children] => Array
(
)
)
)
)
[1] => Array
(
[kind_id] => 1104
[kind_fid] => 1101
[kind_name] => sdfsdf
[children] => Array
(
[0] => Array
(
[kind_id] => 1110
[kind_fid] => 1104
[kind_name] => test222
相关文章
相关视频
上一篇: Js中Array数组学习总结