php FLEA中二叉树数组的遍历输出_PHP
程序员文章站
2022-05-07 11:28:01
...
但是要怎样遍历这个方法产生的二叉树数组呢?以下是我的做法:
复制代码 代码如下:
function preTree($cat){
foreach ($cat as $c){
?>
}
}
?>
复制代码 代码如下:
function preTree($cat){
foreach ($cat as $c){
?>
=$c['poper']?>:=t($c['content'])?>
-
=$s['poper']?>:=t($s['content'])?>
if(isset($s['childrens'])){
?>-
$this->preTree($s['childrens']);
?>
?>
-
$this->preTree($s['childrens']);
}
}
?>
上一篇: php验证码实现局部刷新