JSON字符串不能正确解析PHP


JSON String not parsing correctly PHP

我从API调用中得到以下输出:

$json = file_get_contents($service_url);

$json的var_dump给我:

string(308) " [{"Transaction_ID":2805579},{"Transaction_ID":2777876},{"Transaction_ID":2808406}]"
然而,

Var_dump (json_decode($json))返回null。

我做错了什么?

参见:http://php.net/manual/en/function.json-decode.php

decode_json不是一个函数,你应该使用json_decode

var_dump(json_decode($json))