/** * 屏蔽关键字 * * @access public * @param $len int 字符串长度 * @return string * @author ly|神之谴* @return string
*/
function shield($string)
{
$txt = file_get_contents(dirname(__FILE__).'/shield.txt');
$word = preg_replace("/[1,2,3]\r\n|\r\n/i", '|', $txt);
return preg_replace('/'.$word.'/', "*", $string);
}