I am trying to create a recursive tokenizer that would handle this string and convert it into a multidimensional array.
Input:
a,b,c(a,b,c),d(a,b(a,b)),e
Output
$r = [
'a' => 'a',
'b' => 'b',
'c' => [
'a' => 'a',
'b' => 'b',
'c' => 'c'
],
'd' => [
'a' => 'a',
'b' => [
'a',
'b'
]
],
'e' => 'e'
];
Any ideas?