Home >php教程 >php手册 >php无限极分类递归排序

php无限极分类递归排序

WBOY
WBOYOriginal
2016-05-26 08:21:051252browse

<?php
function order ($array,$pid=0){   
    $arr = array();   
       
    foreach($array as $v){   
        if($v[&#39;pid&#39;]==$pid){   
            $arr[] = $v;   
            $arr = array_merge($arr,order($array,$v[&#39;id&#39;]));   
        }  //phprm.com 
    }   
    return $arr;   
}


本文地址:

转载随意,但请附上文章地址:-)

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