php ul li 分类

<?php
function do_tree($arr,$pid){
echo "<ul>";
foreach ($arr as $key => $value) {
if($value['pid']==$pid){
echo "<li>";
echo $value['area'];
echo "</li>";
do_tree($arr,$value['id']);
}
}
echo "</ul>";
}

?>

posted @ 2016-07-29 16:56  (BACH)  阅读(284)  评论(0编辑  收藏  举报