Blogger Information
Blog 43
fans 2
comment 2
visits 113225
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
htmlspecialchars()方法验证内容导致前端输出字符
朝游东海
Original
935 people have browsed it

利用I方法验证$_POST['content']//富文本内容

    因为I方法运行了  htmlspecialchars(),所以存在数据表的的内容为字符串,前端读取这个字段,不处理的话,里面的html文本标签等将作为字符直接输出来,从而达不到想要的效果,解决方法;

把这个字符串        $str = htmlspecialchars_decode($str);   运行一下,就可以避免html文本直接以字符的形式输出 


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post