JSON解码导致语法错误

时间:2016-11-07 04:51:21

标签: php json

我使用CURL函数进行API调用,而且我无法解码得到的json。

当我用json_last_error()检查时,它说"语法错误,格式错误的JSON"。

但我不确定其中的语法错误是什么。

我尝试在互联网上使用以下功能,但问题仍未解决。

  1. ヶ辆((字符串)$结果);
  2. 修剪($结果);
  3. 我得到的结果如下:

    {"transactionResponse":{"responseCode":"3","authCode":"","avsResultCode":"P","cvvResultCode":"","cavvResultCode":"","transId":"0","refTransID":"","transHash":"AA22864D4298A9C13B16CA5C4B00087F","testRequest":"0","accountNumber":"XXXX0015","accountType":"MasterCard","errors":[{"errorCode":"11","errorText":"A duplicate transaction has been submitted."}],"transHashSha2":""},"refId":"9898989898","messages":{"resultCode":"Error","message":[{"code":"E00027","text":"The transaction was unsuccessful."}]}}
    

    请帮我解决这个问题。

    非常感谢。

0 个答案:

没有答案