php过滤一些网站的敏感词语,并转换成**显示
<?php
$word = array('非法词1','非法词2','非法词3');
function filter($word){
foreach($word as $val){
$text = str_replace($val,'**',$text);
}
return $text;
}
?>
(南京欣才PHP培训机构)