ec(2); 代码如下 复制代码 $v = array('vv','bb'); $str = "vv,cc,abcde,www.111cn.net,vv"; $str=preg_replace("/$v[0]/","".$v[0]."",$str,1); echo $str; //bb,cc,abcde,www.111cn.net,vv $str=preg_replace("/$v[0]/","".$v[0]."",$str,2); //bb,cc,abcde,www.111cn.net,bb