文字列内の同じ針を配列外の異なる値に置き換える方法はありますか?
そのように:
$string = ">>>?<<<>>>?<<<>>>?<<<"; // replacing the three occourances of "?"
// values of array
echo str_multiple_replace($string, array("Hello", "World", "!"));
出力:
">>>Hallo<<<>>>World<<<>>>!<<<"
関数 str_multiple_replace は、3 つの疑問符を配列の内容に置き換えるにはどうすればよいでしょうか。
編集: コンテンツが置換に影響しないようにします。たとえば、「?」がある場合 配列では、置き換えるべきではありません。