php反函数
发布时间: 2023-08-11 20:07:20
❶ php如何处理html标签
需要用到一个函数实现,htmlentities,就是将字符串转换成html实体,用法你可以查一下php手册,同时它还有个反函数,htmlspecialchars_decode
❷ 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个特殊字符!
html_entity_decode() 函数
把 HTML 实体转换为字符。
热点内容