PHP针对HTML实体字符的转义函数有:1、【htmlspecialchars()】转义特别的字符为HTML实体;2、【htmlspecialchars_decode()】将实体转成HTML代码。
【 相关学习推荐: php图文教程 】
PHP针对HTML实体字符的转义函数有:
1、 htmlspecialchars() 转义特别的字符为HTML实体;
'&' (ampersand) becomes '&''"' (double quote) becomes '"' when ENT_NOQUOTES is not set.''' (single quote) becomes ''' only when ENT_QUOTES is set.'<' (less than) becomes '<''>' (greater than) becomes '>'2、 htmlspecialchars_decode() 将实体转成HTML代码,函数1的反函数。
3、 htmlentities()
这个是全部转换html实体,和htmlspecialchars()区别在于,这个函数是转义全部的字符,而htmlspecialchars()仅仅转义上面限定的5个特殊字符!
4、 html_entity_decode() 函数
把 HTML 实体转换为字符。
想了解更多相关学习,敬请关注php培训栏目!
以上就是PHP针对HTML实体字符的转义函数有哪些的详细内容!
查看更多关于PHP针对HTML实体字符的转义函数有哪些的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did54307
PHP针对HTML实体字符的转义函数有哪些
阅读:41次