htmlentities 和 htmlspecialchar

htmlentities 和 htmlspecialchar 功能都是转换HTML代码至普通的字符,而HTML代码中包含中文时,使用 htmlentities会产生乱码,而 htmlspecialchar 不会。 很明显,htmlspecialchar转化时只针对特定的字符。PHP手册上的解释:

htmlspecialchars ── Convert special characters to HTML entities
htmlentities ── Convert all applicable characters to HTML entities

相关文章:

“htmlentities 和 htmlspecialchar” 有2条回响

金融危机三月 21st, 2009 at 6:34 下午

网站的META DESCRIPTON 用不了是咋回事呀?

回复

LD 回复:

什么系统? 不行自己加也行, WP的话有时候插件也会有影响

回复

雁过留声,风过流痕, 人过留名.
请领导点评: