string str_replace (string needle, string str, string haystack)
この関数は、 haystack の中の needle を全て str に置 換します。技巧的な置換ルールを必要としない場合、 ereg_replace() の替わりにこの関数を常用するべき です。
例 1. str_replace()の例
|
この関数はバイナリでも使用可能です。
str_replace() は PHP 3.0.6 で追加されましたが、 PHP 3.0.8 まではバグがありました。
ereg_replace() および strtr() も参照下さい。