I have an array with 30k items, and implode returns nothing. No error message, no memory problems, just nothing.
If I use array_slice
and slice the array to 100 items, it works fine. It also works for 7k array, but not for this one.
However, in another topic I found this code, which works just fine:
$arr = array();
for ($i = 0; $i < 50000; $i++) {
$arr[] = str_shuffle('This sentance is of average length, which The Internet says is aboout 14.2 words.');
}
echo implode(PHP_EOL, $arr);
But with PHP_EOL I can't use that in my select, the string needs to be seperated by ','.
So I have two questions: is there any way to make this work and how can I catch this error? Because testing the implode output does not work, is_null, strlen, is_string, empty, isset, all these tests fail.
"` instead of PHP_EOL – krishna Feb 25 '14 at 13:18