Home >Backend Development >PHP Tutorial >JSON校验出现Expected EOF,求大神能够耐心的解决我的问题

JSON校验出现Expected EOF,求大神能够耐心的解决我的问题

WBOY
WBOYOriginal
2016-06-06 20:41:422450browse

我在校验json格式化的时候,出现了如下错误。

JSON校验出现Expected  EOF,求大神能够耐心的解决我的问题

老是提示的是EOF,说是那里的逗号是有问题的。。。请问这个逗号有啥问题呢?如何修改这个毛病?
这是一个如下的路径:

<code>{
    "cCode": "010",
    "lon": "116.166116",
    "cName": "北京市",
    "adCode": "110106",
    "pName": "北京园博园(6号门)",
    "adName": "丰台区",
    "lat": "39.878187"
},
{
    "cCode": "010",
    "lon": "116.145997",
    "cName": "北京市",
    "adCode": "110106",
    "pName": "滨河公园",
    "adName": "丰台区",
    "lat": "39.790856"
},
</code>

就出现这个逗号的问题。。。。。。。。。。。。。。。。。

回复内容:

我在校验json格式化的时候,出现了如下错误。

JSON校验出现Expected  EOF,求大神能够耐心的解决我的问题

老是提示的是EOF,说是那里的逗号是有问题的。。。请问这个逗号有啥问题呢?如何修改这个毛病?
这是一个如下的路径:

<code>{
    "cCode": "010",
    "lon": "116.166116",
    "cName": "北京市",
    "adCode": "110106",
    "pName": "北京园博园(6号门)",
    "adName": "丰台区",
    "lat": "39.878187"
},
{
    "cCode": "010",
    "lon": "116.145997",
    "cName": "北京市",
    "adCode": "110106",
    "pName": "滨河公园",
    "adName": "丰台区",
    "lat": "39.790856"
},
</code>

就出现这个逗号的问题。。。。。。。。。。。。。。。。。

<code>[
    {
        "cCode": "010",
        "lon": "116.166116",
        "cName": "北京市",
        "adCode": "110106",
        "pName": "北京园博园(6号门)",
        "adName": "丰台区",
        "lat": "39.878187"
    },
    {
        "cCode": "010",
        "lon": "116.145997",
        "cName": "北京市",
        "adCode": "110106",
        "pName": "滨河公园",
        "adName": "丰台区",
        "lat": "39.790856"
    }
]
</code>

你的json应该是包含在一个数组里面了,就像上面的回答

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn