Just testing found a simple, seemingly correct code that was wrong:
<? "{' name ': ' Eric ', ' age ': +}"
As you know, the PHP version has added two JSON-capable functions since 5.2.0, namely Json_encode and Json_decode, where the Json_decode function converts the JSON string to a JSON object, as shown in the previous example. But the output of the above example is null, that is, the conversion failed. This is why, Baidu, some people say that PHP's two functions of the JSON support is not completely caused by the solution is written in the following form:
<? '{' name ': ' Eric ', ' age ': all,}'; // //
Just change the single quote to double quotes, but is this really a mistake for PHP? Then on the JSON official website found that the double quotation marks is the standard JSON, single quotation marks are not standard (although in JS is the line of the pass)! So everyone in the future to develop a habit, the name of the JSON and string values are quoted in double quotes ~
Transferred from: http://www.lanrenmaku.com/JSON/2014_1116_1294.html
JSON Standard: double quotes rather than single quotes!