欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php 将一个二维数组转换成有父子关系的数组_PHP教程

程序员文章站 2022-04-02 11:04:45
...
leaf(0);
 *   $nav=$tree->navi(15);
 
     = 
      __construct(,  = ('id', 'pid'),  = 0->result = ->fields = ->root = ->
      (->result  [[->fields[1]]][] = ( ( = ();  > 0; -- (   =>  (!(, -> (!->->tmp = (, ->already[] =  (   =>  ([->fields[0]] == ->tmp[0[][]['child'] = ->tmp[1->tmp = (, [->tmp = ->tmp = 
      recur_n(,  (   ([->fields[0]] == ->arr[] =  ([->fields[1]] != ->root) ->recur_n(, [->fields[1
      recur_p( (  ->arr[] = [->fields[0 (['child']) ->recur_p(['child'
      leaf( =  = ( == ) ? ->root :  ->tmp[
      navi(->arr = ->recur_n(->result, (-> ->
      leafid(->arr = ->arr[] = ->recur_p(->leaf( ->?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/440239.htmlTechArticle? = __construct( , = ('id', 'pid'), = 0 -result = -fields = -root = - ( -result [ [ -fields[1]]][] = ( ( = ( ); 0; -- ( = (! ( , - (! - -tmp = ( , -already[] = ( = ( [ -fields[0]]...