<?php
$subject=1235612371238;
$word=123;
$pattern="#.*($word).*#sUi";
echo preg_replace($pattern, "0", $subject);
?>
想描红所有123 但是返回的结果却是008,而不是预想的0560708,是哪里出的问题呢?
------解决方案--------------------
<?PHP
$subject=1235612371238;
$word=123;
$pattern="/.*($word).*/sUi";
//echo preg_replace($pattern, "0", $subject);
var_dump(Strtr($subject,Array('123'=>'0')));