How can I correctly convert data from one MySQL column to an array?
E.g. the string is:
$string = $row['1'].",";
$array = explode (',', $string);
echo "$string";
print_r ($array);
echo "$string"; returns correct results - i.e. something,something_else,something_else1 ...
Now I would like to convert the string it created to an array named $array. But when I explode $string (using comma as the separator because it was present in the original string) it doesn't convert it properly.
Instead of creating standard array where "something" is Array 0, "something_else" is Array 1 and "something_else1" is Array 2, it creates Array where "something" is Array 0, "something_else" is Array 1 BUT "something_else1" is again Array 0 despite it should be Array 2 and it goes on this way for the whole string.
It's driving me crazy! I have no idea where the problem is.
Thanks for any help.
Tomas