Home  >  Article  >  Backend Development  >  PHP filter dangerous html code_PHP tutorial

PHP filter dangerous html code_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:45:23879browse

#HTML posted by users, filter dangerous codes

Copy code The code is as follows:

function uh($str)
{
$farr = array(
"/s+/", //Filter excess whitespace
"/<(/?)(scripti?framestylehtmlbodytitlelinkmeta?%)([^>]*? )>/isU", //Filter