我婉更换"hello world."
,之后与"hi" from "this is nice place. <br> hello world.<br>thanks and regards"
与使用preg_replace()
中的preg_replace()面临的问题
代码的任何字符就是这样
$arr1 = array('/hello world./');
$arr2 = array('hi');
$str = "this is nice place. <br> hello world.<br>thanks and regards.";
echo preg_replace($arr1, $arr2, $str);
但这个我不仅能取代“你好,世界。”从$ str。但是我想要正则表达式来替换“hello world”之后的所有字符。也。
所以......有什么问题吗?你的代码(有点)有效。 – Amadan 2011-12-29 09:29:20
但与此我不仅能够取代“你好世界”。从$ str。但是我想要正则表达式来替换“hello world”之后的所有字符。也。 – 2011-12-29 09:33:12