Home  >  Article  >  Backend Development  >  怎么生成个类似TREE结构的数组

怎么生成个类似TREE结构的数组

WBOY
WBOYOriginal
2016-06-13 12:50:381141browse

如何生成个类似TREE结构的数组?


数据是上面那样子。
想成长的数组格式如下

<br />
array(<br />
0=>array('url'=>a.php,'name'=>A页面,'zijiedian'=>array(0=>array('url'=>c.php,'name'=>C页面),1=>array('url'=>e.php,'name'=>E页面)))<br />
1=>array('url'=>b.php,'name'=>B页面,'zijiedian'=>array(0=>array('url'=>d.php,'name'=>D页面)))<br />
)<br />


求如何以最快的速度生成这样的数组。。。数组就是二维的。


------解决方案--------------------
http://bbs.csdn.net/topics/390364669
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn