$string = "[abc] my [efg] best [hij]";
最初に[]をハイに変更します。
second []はHelloに変更します。
3番目の[]世界に変更します。
文字列を別の結果に置き換えます。
文字列全体が動的です。 (これは、異なる結果を示して常にある。) 例:
$string = "[iii] my my [ooo] yes to all [eee]";
$string = "[abc] lovely [efg] [hij]";
$string = "[abc] my [efg] best of the the the the [hij]. That Right.";
私はこのコードを試みたことができますが、それは同じ値にすべてを交換してください。
$string = preg_replace('/\[(.*?)\]/',"Hi",$string);
交換すると、こんにちは、こんにちは世界になります。それにstr_replace文字列を付けることはできますか?
$ string = "test test"; '' $ string = "テストテストテスト"; "に変更するか、または" second test change to Hello "で変更します。 –