Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
439 views
in Technique[技术] by (71.8m points)

json_encode 处理大数据问题

用json_encode把大数据转成json的时候发现 内存耗尽了。又没什么解决方案可以替代json_encode,还有循环大数据时好像也会出现这个问题 又怎么解决呢


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
//设定脚本无超时时间
set_time_limit(0);

//设置脚本可用最大内存
ini_set("memory_limit","2048M");

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...