I have this variable.
$var = \"A,B,C,D,\'1,2,3,4,5,6\',E,F\";
I want to explode it so that I get the following array.
array( [0
You need to explode the string to array.
But, you need commas after every element except last one.
Here is working example:
Demo