webservice调用后,json_decode返回NULL
有一个奇怪的行为json_encode和json_decode我不能找到一个解决方案:
我的php应用程序调用php Web服务。webservice返回如下所示的json:
var_dump($foo):string(62) "{"action":"set","user":"123123123123","status":"OK"}"现在我想在我的应用程序中解码json:
$data = json_decode($foo, true)
但它返回NULL:
var_dump($data):NULL
我用的是php5。来自webservice的响应的Content-Type :( "text/html; charset=utf-8"也尝试使用"application/json; charset=utf-8")
可能是什么原因?
波斯汪
翻翻过去那场雪
UYOU
随时随地看视频慕课网APP