----- 网上的--------------
http://webhole.net/2009/08/31/how-to-read-json-data-with-php/ 最终解决方案 更新时间 2012年5月31日0:38:42 How To Parse JSON With PHP
------网上找的------------
【其他情况】
在 http://php.net/manual/en/function.json-decode.php (我在网上下载的php manual chm中竟然 没有写这些.真无语... ) 中有写到: Example #3 common mistakes using json_decode() 一些大家常常常常常常常常常常常常常常犯的错误.. 其他几个例子也可以看看...
<?php
// the following strings are valid JavaScript but not valid JSON
// the name and value must be enclosed in double quotes 1.这里是说不要使用单引号,正确应该是 $bad_json = '{ "bar": "baz" }';
// single quotes are not valid
$bad_json = "{ 'bar': 'baz' }";
json_decode($bad_json); // null
// the name must be enclosed in double quotes 2.这里是说 名称应该要用""包含起来.. 正确的应该是 $bad_json = '{ "bar": "baz" }';就光这个浪费我好几个小时....弄了半天...哎...
$bad_json = '{ bar: "baz" }';
json_decode($bad_json); // null
// trailing commas are not allowed 3.这里是说 最后一个不需要逗号.
$bad_json = '{ bar: "baz", }';
json_decode($bad_json); // null
?>