E.g. the string is:
Code: Select all
$string = $row['1'].",";
$array = explode (',', $string);
echo "$string";
print_r ($array);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