$xiangmu='1,2,3'; $xiangmu=explode(',',$jc['xiangmu']); $xm=''; for($i=0;$i<count($f)-1;$i++){ $xm[$i]=M('Member_card_xuanxiang')->where(array('id'=>$f[$i]))->find(); } $this->assign('xm',$xm);