为什么我的 JSOn 代码错误?

Why my JSOn code error?

我试图将 JSON 连接到我的数据库以访问用户列表,但出现此错误:

Uncaught Unable to parse the JSON returned by the server: You're trying to decode an invalid JSON String: [{gid:"7503",cn:"Marketing",}]
Notice: Undefined variable: ldapcon in C:\xampp\htdocs\site\resources\admin\getGroups.php on line 38

我猜,我忘了在里面加上逗号,你能帮帮我吗?

JSON 要求键在双引号字符串中,不能有尾随逗号:

{"gid":"7503","cn":"Marketing"}