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...