我收到此错误:
解析错误:语法错误,第 2 行 C:\wamp\www\test.php 中的意外 T_STRING
在尝试从Reddit 的首页打印密钥时
如何修复 *$json_string* 解析错误并从Reddit 的首页显示密钥?提前致谢。
测试.php
<?php
$json_string = "{"kind": "Listing", "data": {"modhash": "", "children": [{"kind": "t3", "data": {"domain": "i.imgur.com", "banned_by": null, "media_embed": {}, "subreddit": "pics", "selftext_html": null, "selftext": "", "likes": null, "link_flair_text": null, "id": "1d7lch", "clicked": false, "title": "Graves of a Catholic woman and her Protestant husband, who were not allowed to be buried together.", ... ";
$a = json_decode($json_string);
echo $a.keys();
?>