多看文档,文档上写的清清楚楚,search和replace都可以为数组 文档: http://php.net/manual/zh/func...文档中的例子:执行结果 <?php $phrase = "You should eat fruits, vegetables, and fiber every day."; $healthy = array("fruits", "vegetables", "fiber"); $yummy = array("pizza", "beer", "ice cream"); $newphrase = str_replace($healthy, $yummy, $phrase); var_dump($newphrase); // "You should eat pizza, beer, and ice cream every day."
多看文档,文档上写的清清楚楚,
search
和replace
都可以为数组文档: http://php.net/manual/zh/func...
文档中的例子:执行结果