Home > Backend Development > PHP Tutorial > php FLEA中二叉树数组的遍历输出_PHP

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

WBOY
Release: 2016-06-01 12:10:32
Original
1203 people have browsed it

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

复制代码 代码如下:
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']);
      ?>
    }
    ?>





}
}
?>
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template