Convert Javascript Array into PHP Array

Standard

String Javascript Array
For Example: [“A”,2,[[1,1,1,"A","J",1],[1,2,1,"B","J",1],[1,4,1,"C","J",1]]]

$string_array = '["A",2,[[1,1,1,"A","J",1],[1,2,1,"B","J",1],[1,4,1,"C","J",1]]]';

Convert String to Value/array in PHP

$array = eval("return $string_array;");

Result Array

print_r($array);

Full Code:

$string_array = '["A",2,[[1,1,1,"A","J",1],[1,2,1,"B","J",1],[1,4,1,"C","J",1]]]';

$array = eval("return $string_array;");
print_r($array);