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.
(50000 * 82) / 1024 / 1024
) more content for every single request. – Kyoko"<br>"
instead of PHP_EOL – TrautmansomeClassName.php
? – Kyoko$available_brands_array
isn't a string - it's a class of the typesomeClassName
. Useprint_r
and figure out which, or use the following: pastebin.com/XJHg8dpH – Kyoko