phpcms 杂乱总结

1.根据catid 获取 栏目名称

$CATEGORYS = getcache('category_content_'.$siteid,'commons');
$name = {$CATEGORYS[$catid]['catname']}

2.根据catid 取子栏目的catid和名称

/*
     * 根据catid 取子栏目
     */
    private function get_child_catid($parents_catid){
        $categorys = getcache('category_content_1','commons');
        $arrchildid = $categorys[$parents_catid][arrchildid];
        $arrchildid = explode(',',$arrchildid);
        $result = array();
        foreach($arrchildid as $k=>$v){
            $name = $categorys[$v]['catname'];
            $result[$k]['catid']=$v;
            $result[$k]['catname']=$name;
        }
        $result = array_slice($result,1);
        return $result;
    }
原文地址:https://www.cnblogs.com/mr-amazing/p/3954352.html