是否有可能嵌套数组json? [英] Is it possible to have nested array json?

查看:297
本文介绍了是否有可能嵌套数组json?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有点喜欢json.因此,我想在一个像下面这样的数组值中创建一个数组值.

I'm kinda new with json. So I want to make an array value inside a value of an array like below.

{
    "id": 0,
    "title": "LEVEL",
    "value": [10[2,3,5], 1]
}

但不幸的是,它没有用.当我尝试读取数据时,它给了我一个错误.

But unfortunately It's not working. It gives me an error when I tried to read the data.

我想知道是否可以在数组值中包含一个数组.谢谢.

I want to know if it's possible to have an array inside an array value. Thank you.

推荐答案

{
"id": 0,
"title": "LEVEL",
"value": [10, [2, 3, 5], 1]

}

选项2:

    {
    "id": 0,
    "title": "LEVEL",
    "value": [10, {
        "someKey": [2, 3, 5]
    }, 1]
}

选项3:

       {
    "id": 0,
    "title": "LEVEL",
    "value": [10, {
        "someKey": [2, {
            "someKey": [9, 1, 1]
        }, 5]
    }, 1]
   }

这篇关于是否有可能嵌套数组json?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆