php实现无限极分类
//递归思想
function tree($list,$pid=0,$level=0,$html='--'){
static $tree=array();//采用静态,递归调用也不会将其重置
foreach($list as $value){
if($value['pid']==$pid){
$value['level']=$level;
$value['html']=str_repeat($html,$level);
$tree[]=$value;