json_decode在php中的一些无法解析的字符串
关于json_decode在php中的一些无法解析的字符串,包括以下几种常见类型。
一、Bug #42186 json_decode() won't work with \l
当字符串中含有\l的时候,json_decode是无法解析,测试代码:
echo "<br/>***********decode chokes on unquoted object keys*************<br/>";var_dump(json_decode('{"a":"tan","model":"sedan"}'));//object(stdClass)[1] public 'a' => string 'tan' (length=3) public 'model' => string 'sedan' (length=5)var_dump(json_decode('{a:"tan","model":"sedan"}'));//null