preg_replace无效
<?php
// $pattern = '/[0-9]/';
$pattern = array('/[0123]/', '/[456]/', '/[789]');
$subject = 'weuyr3ui76as83s0ck9';
// $subject = array('weuy', 'r3ui', '76as83', 's', '0ck9');
// $replacement = '姆女神';
$replacement = array('姆', '女', '神');
$str1 = preg_replace($pattern, $replacement, $subject);
$str2 = preg_filter($pattern, $replacement, $subject);
show($subject);
echo "<hr \>";
show($str1);
echo "<hr \>";
show($str2);
function show ($var = null)
{
if (empty($var))
{
echo "null";
}
else if (is_array($var) || is_object($var))
{
echo "<pre>";
print_r($var);
echo "</pre>";
}
else
{
echo $var;
}
}
?>