PHP can be applied to breadcrumb navigation recursive search tree implementation method, applied to genealogy
In this paper, we describe the recursive search tree implementation method that PHP can apply to breadcrumb navigation. Share to everyone for your reference. The implementation method is as follows:
<?phpecho ""; $area = array (' ID ' =>1, ' area ' = ' Beijing ', ' pid ' =>0), array (' ID ' =>2, ' area ' = ' Guangxi ', ' pid ' =>0), Array (' ID ' =>3, ' area ' = ' Guangdong ', ' pid ' =>0), array (' ID ' =>4, ' area ' = ' Fujian ', ' pid ' =>0), array (' ID ' =>11, ' Area ' = ' Chaoyang ', ' pid ' =>1 ', array (' ID ' =>12, ' area ' = ' Haidian ', ' pid ' =>1), array (' ID ' =>21, ' area ' = ') Nanning ', ' pid ' =>2), array (' ID ' =>45, ' area ' + ' Fuzhou ', ' pid ' =>4), array (' ID ' =>113, ' area ' = ' Asian Games Village ', ' pid ' = >11), array (' ID ' =>115, ' area ' = ' Olympic Village ', ' pid ' =>11), array (' ID ' =>234, ' area ' = ' wuming county ', ' pid ' =>21 '); function Familytree ($arr, $id) {Static $list = Array (), foreach ($arr as $v) {if ($v [' id ']== $id) { familytree ($arr, $v [' PID ']); $list [] = $v; }} return $list;} Print_r (Familytree ($list, 113));? >
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/951639.html www.bkjia.com true http://www.bkjia.com/PHPjc/951639.html techarticle PHP can be applied to breadcrumb navigation recursive search tree implementation method, applied to genealogy This paper describes a recursive search tree implementation method that PHP can apply to breadcrumb navigation. Share to ...