我正在使用来自http://api.ihackernews.com/的hackernews api 。我通过 JSON 获得结果。
我在使用 php 函数 json_decode() 时遇到问题。它工作正常,除非有很多双引号。
错误在于
"Ask PG: Will you post an update to "StartupIdeasWeu0027dLiketoFund"?"
:
{
"title": "Ask PG: Will you post an update to "StartupIdeasWeu0027dLiketoFund"?",
"url": "/comments/6014422",
"id": 6014422,
"commentCount": 58,
"points": 214,
"postedAgo": "12 hours ago",
"postedBy": "awwstn"
}
我该如何"Ask PG: Will you post an update to "StartupIdeasWeu0027dLiketoFund"?"
替换"Ask PG: Will you post an update to \"StartupIdeasWeu0027dLiketoFund\"?"
?