摘要: PHP 5.4.3 环境中测试了一个在 PHP 5.2 环境下运行正常的程序,却发现本应正常提交一个中文字符串到数据库的代码却提交了一个空字符串,经过排查,该字符串在经 htmlspecialchars 函数转义之前正常,而在转义之后却变成了空字符串。调用例子如下:$str='中文字符串';$str_converted= htmlspecialchars($str);echo$str_converted;遂查看PHP手册,获知 htmlspecialchars 函数原型如下:string htmlspecialchars ( string $string [, int $fla 阅读全文
posted @ 2013-10-09 17:15 山貓 阅读(376) 评论(0) 推荐(0) 编辑