复制代码 代码如下: <?php header(“Content-type: text/html; charset=utf-8”); function multiple_replace_words($word,$replace,$string,$tmp_match=’#a_a#’){ preg_match_all(‘/’.$word.’/’,$string,$matches); //匹配所有关键词 $search = explode(‘,’,’/’.implode(‘/,/’,$matches[0]).’/’); //不存在匹配关键词 if(empty($matches[0])) ret