慕虎7371278
$tag=str_replace(",",",",I("post.tag")); $tag=explode(",", $tag); if(count($tag)>0){ foreach($tag as $v){ if(M("tag")->where(array('tab_name'=>$v))->find()){ M("tag")->where(array('tab_name'=>$v))->setInc("tab_count",1); }else{ M("tag")->add(array('tab_name'=>$v,'tab_count'=>1)); }12 } }