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
Simply use preg_match_all with the following regex as follows
preg_match_all
preg_match_all("/(?<=').*(?=')|\w+/",$var,$m); print_r($m[0]);
Regex Explanation :
(?<=').*(?=')
'(quotes)
|\w+
|(OR)
,
Demo
Regex