PHP json双引号要求

PHP's JSON decode requires a JSON formatted with field names enclosed in double quotes like:

{"foo-bar": 12345, "myName": "Johnnie"}

But I have to parse some relatively complex JSON made by a Java application that is formatted with names without double quotes on field names like:

{foo-bar: 13456, myName: "Johnnie"}

...but more complex. Is there some easy way to fix this or am I screwed?

This requirement follows the JSON specification. If you look at the charts at http://json.org/ you will see that an object consists out of string:value pairs.

JSON object description

A string is defined to have quotes enclosing Unicode characters.

JSON sring description

The data you have is not valid JSON.