PHP安全之数据过滤和验证

1、使用htmlentities()过滤html:

过滤结果: <script>alert("Helloweba");</script>


2、使用filter_var()验证Email: hello@example.com

验证结果:成功