时间:2021-07-01 10:21:17 帮助过:14人阅读
$subject=1235612371238;
$word=123;
$pattern="#.*($word).*#sUi";
echo preg_replace($pattern, "0", $subject);
?>
$subject=1235612371238;
$word=123;
$pattern="/.*($word).*/sUi";
//echo preg_replace($pattern, "0", $subject);
var_dump(Strtr($subject,Array('123'=>'0')));