1. 首页
  2. 数据库
  3. 其它
  4. php数组一对一替换实现代码

php数组一对一替换实现代码

上传者: 2020-12-23 01:06:18上传 PDF文件 35.55KB 热度 8次
复制代码 代码如下: <?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
下载地址
用户评论