时间:2021-07-01 10:21:17 帮助过:45人阅读
$html = "abc,abc,abc,abc,......";
echo preg_replace('/abc/e','++$i',$html);
$str = 'abc,abc,abcabc';
$i=1;
$newstr = preg_replace_callback('
------解决方案--------------------
abc
------解决方案--------------------
', function($match) use(&$i){return $i++;}, $str);
echo $newstr;