时间:2021-07-01 10:21:17 帮助过:24人阅读
$expression ="/@呲牙/";
$reexpression ="呲牙";
$text=preg_replace($expression,' ',$text);
$expression =array("/@呲牙/","/@鄙视/","/@折磨/");
$reexpression =array("呲牙","鄙视","折磨");
$text=preg_replace($expression,' ',$text);
$text = '别@呲牙了,->@鄙视<-';
$reexpression =array("呲牙","鄙视","折磨");
// 希望你的程序最好以UTF-8编码,u修饰符的作用就是避免编码出现意外的混乱
$find = '#@('. join('
------解决方案--------------------
', $reexpression) .')#u';
$replace = '';
$text = preg_replace($find, $replace, $text);