首页 > 解决方案 > php explode is hitting maximum size

问题描述

I have a script which gathers information from a linux command and then splits the string into an array

Problem is once the command gathers loads of lines the explode function just stops working

$fetch = shell_exec('BIGLISTOFNEWLINESPERATEDDATA');

$fetcharray = explode("\n", $fetch);

I have also tried-

$fetcharray = explode("\n", $fetch,-1);

and

$fetcharray = preg_split("\n", $fetch);

But they all have the same issue - I know that the string command itself is fine because I can output it as a string no matter what the length...

标签: phpexplode

解决方案


我想通了,php 达到了它的最大内存大小。

我把php.ini它调高了,现在它可以重新渲染更多的数据。


推荐阅读