PHP中的json_decode()问题 [英] json_decode() problems in PHP
本文介绍了PHP中的json_decode()问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下JSON响应使用json_decode()
The following JSON response returns null
using json_decode()
任何想法为何无效,以及如何使它有效解码.
Any ideas why it is invalid, and how can I make it valid to decode.
推荐答案
根据JSONLint,您遇到以下错误:
Accoring to JSONLint, you have the following error:
Parse error on line 82:
... "text": "Make it easier for
-----------------------^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
错误在于字符串'\ x27s'
The error is with this in the string '\x27s'
第92行也一样.
"Roger\x27scompanion\x3cem\x3ehelped\x3c/em\x3ehimwiththeren"
用适当的unicode字符替换它们,或在斜杠转义字符串时添加一个额外的斜杠.
Replace them with their appropriate unicode characters or add an extra slash as one slash is escaping your string.
这篇关于PHP中的json_decode()问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文