htmlspecialchars() 为什么对某些字符不起作用
嗨,我想知道,但也许我错过了一些关于 htmlspecialchars()
的内容,为什么这个函数不能替换所有这些 html 特殊字符 html 特殊字符列表
原因例如字符 %
不是替换为我可以看到的
php 手册说的是:
'&' (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 '>'
那么其他字符呢?没有功能可以全部替换吗?
hi i was wondering but maybe i missed up somenthing about htmlspecialchars()
, why does this function does not a replacement of all this html special character
html special chars list
cause for example the char %
is not replaced as i can see
the php manual says about:
'&' (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 '>'
so about other chars ? no function to replace them all?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
手册告诉您需要了解的一切:
The manual tells you everything you need to know: