24cun_cn 发表于 2017-4-7 06:51:48

php的htmlentities函数htmlspecialchars函数bug记录

php的htmlentities函数htmlspecialchars函数bug记录

当对gbk编码的字符串调用该函数时,偶尔会有返回空的情况。

解决方案:
使用mb_convert_encoding或iconv函数将字符串转utf-8调用这些函数,最后再转回gbk,搞定。
页: [1]
查看完整版本: php的htmlentities函数htmlspecialchars函数bug记录