Php unlimited classification

public function Infinite () { 
        $ Data = $ the this -> SortRepositorie-> Sate (); // isolated classification data
         / * 
        * Data Categories 
        * / 
        $ Array = $ the this -> getTree ($ Data);
 //         print_r ($ Array); Die; 
        return $ Array; 
    } 
// no limit classified 
    public function getTree (Data $, $ PID = 0 ) { 
        $ ARR = Array ();
         the foreach ($ Data AS $ Key => $ value) {
             IF ($ value [ ' PID ']==$pid){
                $arr[$key]=$value;
                $arr[$key]['chid']=$this->getTree($data,$value['id']);
            }
        }
        return $arr;
    }

 

Guess you like

Origin www.cnblogs.com/gwhm/p/11026474.html