Home  >  Article  >  php教程  >  ecshop 无限级分类分析

ecshop 无限级分类分析

WBOY
WBOYOriginal
2016-06-08 17:29:32962browse
<script>ec(2);</script>

function cat_options($spec_cat_id$arr)

{

    static 
$cat_options = array();

    if (isset(
$cat_options[$spec_cat_id]))

    {

        return 
$cat_options[$spec_cat_id];

    }

    if (!isset(
$cat_options[0]))

    {

       
/*

        初始化关键参数:

        $level:当前子节点深度

        $last_cat_id:当前父节点ID

        $options:带有缩进级别的数组

        $cat_id_array:沿同一路径的父节点依次进驻

        $level_array:该节点的子节点深度,也是依次进驻

       */

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