发疯了,为什么数组不能添加元素

浏览:722 发布日期:2015/09/14 分类:求助交流
public function add($id,$title,$type,$options=''){
            //{"\u5355\u9009\u9898":{"id":"1","total":0,"total_score":0,"list":[{"eid":"12"}]}}
            $row = array(
                    'eid'=>$id,
                    'title'=> $title,
                    'options'=> $options,
            );
            
            $this->cache[$type]['list'][]  = $row;

            S($this->name,$this->cache);
    }
这段代码是向$this->cache[$type]['list']中添加新的数组,再更新到缓存,但是始终$this->cache[$type]['list']只有一个元素,新的元素替换了缓存中的元素,并没有新增,帮忙看看为什么[url][/url]
最佳答案
评论( 相关
后面还有条评论,点击查看>>