"hello world."
を交換するワン
とpreg_replace()
直面する問題は、
コードを使用すると"hi" from "this is nice place. <br> hello world.<br>thanks and regards"
とその後の任意の文字は、その
$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
しかしこれで私は "hello world"を置き換えることができるだけではありません。 $ strから。しかし、私は、 "hello world"の後のすべての文字を置き換える正規表現を必要としています。また、 –