I'm not sure why but the explode function doesn't seem to be working for me.
I have a string which contains one or more sets of comma-seperated values. These sets are delimied by starting / ending square brackets.
After stripping off the ending "[" and "]", I thought it would be simple to then use the explode function to get the results seperated by "][". Instead, I get something weird.
$rawInserts = '[1,2,3,4,5][2,3,4,5,6][3,4,5,6,7]';
$the_inserts = substr($rawInserts,1,strlen($rawInserts)-2);
echo "$the_inserts
"; //returns "1,2,3,4,5][2,3,4,5,6][3,4,5,6,7"
$inserts = explode($the_inserts , "][");
echo print_r($inserts)."
"; // returns one item array containing "][";
why is it returning "]["? (FYI, I tried this exact example and it fails).
Thanks in advance.