Home >php教程 >php手册 >php FLEA中二叉树数组的遍历输出

php FLEA中二叉树数组的遍历输出

WBOY
WBOYOriginal
2016-06-13 11:57:11818browse

但是要怎样遍历这个方法产生的二叉树数组呢?以下是我的做法:

复制代码 代码如下:


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']);
      ?>
    }
    ?>





}
}
?>
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