Parsing Javascript (not JSON) in PHP
javascript, php
Solution
Pear Services_JSON will parse that string (tested version 1.31). But given that that is a JSON parser and that this isn't valid JSON you have no guarantee that future versions will still work.
Problem
I have a php string containing the serialization of a javascript object : ``` $string = '{fu:"bar",baz:["bat"]}'; ``` The actual string is far more complicated, of course, but still well-formed javascript. This is not standard JSON, so json_decode fails. Do you know any php library that would parse this string and return a php associative array ?