时间:2021-07-01 10:21:17 帮助过:4人阅读
Array( [0] => Array ( [id] => 10 [pid] => 0 [ppid] => 7 [m_title] => 系统分类 [m_flag] => 1 [m_type] => 0 [m_url] => [m_lage] => 0 [m_seotitle] => [m_seokey] => [m_seodesc] => [m_sort] => 0 [m_time] => 0000-00-00 00:00:00 ) [1] => Array ( [id] => 9 [pid] => 0 [ppid] => 6 [m_title] => 排序管理 [m_flag] => 0 [m_type] => 0 [m_url] => [m_lage] => 0 [m_seotitle] => [m_seokey] => [m_seodesc] => [m_sort] => 0 [m_time] => 0000-00-00 00:00:00 ) [2] => Array ( [id] => 8 [pid] => 0 [ppid] => 6 [m_title] => 登陆日志 [m_flag] => 0 [m_type] => 0 [m_url] => [m_lage] => 0 [m_seotitle] => [m_seokey] => [m_seodesc] => [m_sort] => 0 [m_time] => 0000-00-00 00:00:00 ) [3] => Array ( [id] => 7 [pid] => 0 [ppid] => 6 [m_title] => 系统信息 [m_flag] => 0 [m_type] => 0 [m_url] => 11 [m_lage] => 0 [m_seotitle] => [m_seokey] => [m_seodesc] => [m_sort] => 10 [m_time] => 0000-00-00 00:00:00 ) [4] => Array ( [id] => 6 [pid] => 0 [ppid] => 0 [m_title] => 网站管理 [m_flag] => 1 [m_type] => 4 [m_url] => 11 [m_lage] => 1 [m_seotitle] => [m_seokey] => [m_seodesc] => [m_sort] => 10 [m_time] => 0000-00-00 00:00:00 ) [5] => Array ( [id] => 5 [pid] => 0 [ppid] => 2 [m_title] => 文字链接 [m_flag] => 0 [m_type] => 22 [m_url] => [m_lage] => 0 [m_seotitle] => [m_seokey] => [m_seodesc] => [m_sort] => 10 [m_time] => ) [6] => Array ( [id] => 4 [pid] => 0 [ppid] => 0 [m_title] => 关于我们 [m_flag] => 0 [m_type] => 0 [m_url] => [m_lage] => 0 [m_seotitle] => [m_seokey] => [m_seodesc] => [m_sort] => 10 [m_time] => ) [7] => Array ( [id] => 1 [pid] => 0 [ppid] => 0 [m_title] => 新闻中心 [m_flag] => 0 [m_type] => 0 [m_url] => [m_lage] => 0 [m_seotitle] => [m_seokey] => [m_seodesc] => [m_sort] => 10 [m_time] => ) [8] => Array ( [id] => 2 [pid] => 0 [ppid] => 0 [m_title] => 友情链接 [m_flag] => 0 [m_type] => 0 [m_url] => [m_lage] => 0 [m_seotitle] => [m_seokey] => [m_seodesc] => [m_sort] => 102 [m_time] => ))
function dafenglei_arr($m,$id){ global $class_arr; global $ppid; if($id=="") $id=0; $n = str_pad('',$m,'-',STR_PAD_RIGHT); $n = str_replace("-"," ",$n); for($i=0;$i\n"; echo " "; echo " ".$class_arr[$i]['m_sort']." \n"; echo "".$n."|--".$class_arr[$i]['m_title'].$m." \n"; echo ""; echo " ".$class_arr[$i]['m_flag']." "; echo "修改"; echo " 删除"; echo " \n"; echo "\n"; dafenglei_arr($m+1,$class_arr[$i]['id']); } } }
echo '
echo '
麻烦 老大 再给我修改下 谢谢...就差一点了
你这是一遍扫描,不可能做到的。
你没有发现生成的 html 中多了许多空的
既然 老大都说 不可能做到了..那我也就不折腾了...
两边扫描才可以做到
第一遍,结构化树状数组。这样就可以统计子节点数了
第二遍,输出数组
呵呵 那能给下具体代码?