PHP多個字符串替換PHP
$nn="ab bc cd cd ab";
$tttt=str_ireplace("cd","aaa",$nn);
$tt=str_ireplace("ab","aaa",$tttt);
但下面的編碼工作不
$nn="ab bc cd cd ab";
$tttt=str_ireplace("cd" or "ab","aaa",$nn);
輸出爲 「AAA BC AAA AAA AAA」。請幫我simplyfying it.because有對於各種單詞來說,更多的是替代。
與'foreach'一起使用數組。 – Script47
查找'preg_replace' –
在** PHP **中有關於函數** str_ireplace **的問題,那麼爲什麼不簡單地查看一下手冊? - > http://php.net/manual/en/function.str-ireplace.php < - 答案是 – Rizier123