所以我有以下的PHP字符串:PHP复杂字符串解析,JSON'able?
$output = {"playerId":1178,"percentChange":0.1,"averageDraftPosition":260,"percentOwned":0.1,"mostRecentNews":{"news":"Accardo was called up from Columbus on Monday, the Indians' official Twitter feed reports.","spin":"He'll replace Dan Wheeler on the active roster after carrying a 2.76 ERA over 13 appearances with the Clippers to start the season.","date":"Mon May 14"},"fullName":"Jeremy Accardo"}
我需要的是:“阿卡多是从哥伦布周一,印第安人的官方Twitter的饲料报道叫了起来”和“在与快船开始本赛季13次出场后,他将在主动阵容中替换Dan Wheeler。”作为子串。但我似乎无法弄清楚最好和最优雅的方式来做到这一点。我试图对JSON_decode字符串进行解码,但没有返回任何内容。有任何想法吗? (我正在使用PHP)
你能给我们一段你正在用来解析它的代码吗?另外,请注意,json_decode有第二个变量,可以让你选择它是一个数组还是一个对象。 – Odinn
@ sfgiants2010您的json数据包含许多未转义的单引号,我已修复它,检查我的答案。 –