我正在打开一个 JSON 文件并对其内容进行解码,因此我可以使用 MySQL 将内容插入到我的数据库中:
[{"publisher": "some publisher", "img": "url to image", "title": "some title", "platform": "some platform", "year": "2012", "genre": "some genre", "desc": "this is the description", "id": "1", "developer": "some developer"}]
这只是文件中的条目之一。JSON 文件包含超过 10000 个。我在使用json_decode($file)
. 读取文件并且var_dump($file)
工作正常。所以我的问题是,这是一个好的 JSON 文件吗?或者我如何解码并将其插入数据库?
提前致谢。