<?php header("content-type:text/html;charset=utf-8"); $content= "直接进行排序,绿色字体为未排序问"; $arr = file("./sensitive_word.txt"); //一个敏感词一行 $arr1 = array(); foreach($arr as $k=>$v){ $arr1["num".$k] = trim($v); } echo $content = str_replace($arr1,"*",$content); |