我有这个JSON结果PHP json_decode返回NULL
[{"counter":"542"}]
or
[{"counter":"542"},{"counter":"43"}]
,我有以下代码
$address = "http://localhost/restauranttheme/syncAndroid/getCounterGenerator4Android.php";
$string = file_get_contents($address);
$json_a = json_decode($string);
但我得到空结果$json_a == null
那么问题是什么?
可以请你POST HTTP内容://localhost/restauranttheme/syncAndroid/getCounterGenerator4Android.php – Satya 2013-05-04 06:04:07
你怎么填充'$ json_a'。使用'print_r'或'var_dump'。 – 2013-05-04 06:04:42
如何做一些错误检查? url的内容是否被加载到'$ string'中? – arkascha 2013-05-04 06:06:12