I'm not talking about JSON. I've got a program with the input being a javascript data structure in string format, something like this:
$string = "
var records = new Array();
records[0] = new Record('data1','data2',data3');
records[1] = new Record('data1','data2',data3');
records[2] = new Record('data1','data2',data3');";
Is there an easy way/library to turn this into a PHP data structure? The only way I can think of is to use str_replace to manipulate the string in order to turn it into JSON and then use json_decode.
Just wondering if there's a better way to do it.