I have the following code that is not returning as I expected. I was hoping the final result would be a string:
$organizers = array_unique($organizers); // this returns correctly
$organizers = implode(', ', $organizers); // this returns nothing
var_dump($organizers); // no data appears here
exit;
The array_unique()
function is returning data correctly and I can see the array it returns. To start, the $organizers
array is a simple 1-D array of strings that all have small lengths under 20 chars. I think the issue might be that $organizers
is more than 10,000 indices long. Are there limitations on the length of an array that can be imploded? Are there work-arounds for that? I cannot find anything in the manual, but I have tested this code thoroughly and I believe the error must be on implode()
.
implode()
. Are you simply running out of memory? Do you have error logging on? – Undermine$entry = 'some small string under 20 chars'
when it's 32 characters long :) – Martica$organizers
ever been used in conjunction with an & reference at any point? This can cause unexpected results... – Krieg