You can use json_decode()
:
$string = "1,[1,2,3],[2,2,4],2,3";
$array = json_decode("[$string]", true);
print_r($array);
Output :
Array
(
[0] => 1
[1] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
[2] => Array
(
[0] => 2
[1] => 2
[2] => 4
)
[3] => 2
[4] => 3
)
Above code tested here
CLICK HERE to find out more related problems solutions.