php防止用户输入进行跨站攻击的方式

1.对用户输入的内容进行转义

//1.过滤内容中html标记
$userinput=strip_tags($userinput);
//2.转换成HTML实体
$userinput=htmlentities($userinput);
原文地址:https://www.cnblogs.com/theWayToAce/p/7905301.html