时间:2021-07-01 10:21:17 帮助过:20人阅读
$arr=Array ( 0 => '微笑' ,1 => '色' , 2=>'撇嘴' );$brr=array(1 , 2 , 3);$content='a[色]fdsafd[撇嘴]saf[微笑]b';foreach($arr as &$v) $v = "/\\[$v\\]/";foreach($brr as &$v) $v = "";$content = preg_replace($arr, $brr, $content);echo $content;afdsafdsafb