日期:2014-05-17 浏览次数:20465 次
<?php
$subject=1235612371238;
$word=123;
$pattern="#.*($word).*#sUi";
echo preg_replace($pattern, "0", $subject);
?>
<?PHP
$subject=1235612371238;
$word=123;
$pattern="/.*($word).*/sUi";
//echo preg_replace($pattern, "0", $subject);
var_dump(Strtr($subject,Array('123'=>'0')));