I use PHP to use a service that is not mine. This service returns those things that are almost, but not quite, completely different from JSON (tip tip, HGG).
ie, in their simplest form, they look like this:
{a: 8531329}
Running the specified string through json_decode returns NULL
$foo = json_decode('{a: 8531329}');
The problem is that a not quoted.
$foo = json_decode('{"a": 8531329}');
Does PHP (both initially and through regular packagist packages) offer a method for parsing this string "valid-javascript-but-not-valid-json" into a PHP array or stdClass? Or did I figure it out myself? (my example above is a simple case - the actual strings are quite large)
source share