php base64_decode 内存溢出 Allowed memory size of 啥啥啥
目前有三种情况
- 解码的的内容真的是很大,大到php配置文件跟不上
解决办法:memory_limit的值加大,在服务器文件php.ini - 代码出错
- 从数据库查出来的数据被直接赋值,我的就是这种,其实说来也应该是代码错误,不能这样直接操作,
记录一下
$return_array = [];
for ($i=0; $i < count($newmsg); $i++) {
$return_array[$i] = $newmsg[$i];
$nickname = $newmsg[$i]['nickname'];
//$newmsg[$i]['nickname'] = '';
$return_array[$i]['nickname'] = base64_decode($nickname);
}
return $return_array;
$newmsg便是直接从数据库查出来的数组;
(其实我感觉是我的代码有问题,但是又找不到哪出错,暂时解决了)
还没有评论,来说两句吧...