我正在使用来自http://api.ihackernews.com/的hackernews api。我通过JSON获得结果。
我遇到了php函数json_decode()的问题。它工作正常,除非有很多双引号。
错误在于
"Ask PG: Will you post an update to "StartupIdeasWeu0027dLiketoFund"?"
in:
{
"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\"?"
?