0
我想掃描一個段落並用另一個單詞替換其中的針頭。例如搜索並用數組替換字符串中的單詞
$needles = array('head', 'limbs', 'trunk');
$to_replace = "this";
$haystack = "Main parts of human body is head, Limbs and Trunk";
最後出來放需要
Main part of human body is this, this and this
我該怎麼辦呢?