联系官方销售客服
1835022288
028-61286886
<?php $rt = \Phpcmf\Service::L('cache')->get('module-'.SITE_ID.'-content'); foreach ($rt as $key => $value) { $module[] = $key; } $mod = implode(",",$module); var_dump ($mod); ?>
循环多个模块,以上运行结果输出模块名称 news,jsmk,zjmk
想要排除news模块,用unset($key['news']);
<?php $rt = \Phpcmf\Service::L('cache')->get('module-'.SITE_ID.'-content'); foreach ($rt as $key => $value) { unset($key['news']); //排除news $module[] = $key; } $mod = implode(",",$module); var_dump ($mod); ?>
但是报错,应该怎么修改下,才能排除news模块呢?