首页 > php开发

json_encode 中文显示问题解决方法

json已经成为当前web开发最常用的数据格式,php也从5.2开始支持json和数组的转换函数 json_encode 和 json_decode 。但使用过程中我们会发现,(下面以“你”这个汉字为例)通过json_encode 函数转换后的中文全部变成了类似 u4f60 (你)这样的编码,虽然不影响程序执行,但是很不直观.

阅读全文

php错误提示:Call-time pass-by-reference has been deprecated

今天在写引用时突然出现了Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of getimagesize(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer错误,后来才知道原因是此方法已不被赞成并在 PHP/Zend 未来的版本中很可能不再支持了

阅读全文