-
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 '>'
-
这个是全部转换html实体,和htmlspecialchars()区别在于,这个函数是转义全部的字符,而htmlspecialchars()仅仅转义上面限定的5个特殊字符!
html_entity_decode() 函数
把 HTML 实体转换为字符。
PHP针对HTML实体字符的转义函数
最新推荐文章于 2024-10-24 12:31:49 发布