如何从JSON编码数据中删除数组符号

时间:2019-12-07 18:32:50

标签: php json rest api codeigniter

我正在修改现有的api,并且在看了文档之后,我意识到输出不适合文档描述。所以我尝试了几种方法,但没有得到结果。现在我在这里。

输出:

[
    {
        "id": "2648015",
        "user_id": "355",
        "particular": "15 points debited from your wallet using Fortune Wheel",
        "debit": "15",
        "credit": "0",
        "create_date": "2019-10-24 23:57:52",
        "update_date": "2019-10-24 23:57:52",
        "status": "1",
        "app_id": "3"
    },
    {
        "id": "2647989",
        "user_id": "355",
        "particular": "15 points debited from your wallet",
        "debit": "15",
        "credit": "0",
        "create_date": "2019-10-24 23:57:32",
        "update_date": "2019-10-24 23:57:32",
        "status": "1",
        "app_id": "3"
    }
]

预期输出:

{
    {
        "id": "2648015",
        "user_id": "355",
        "particular": "15 points debited from your wallet using Fortune Wheel",
        "debit": "15",
        "credit": "0",
        "create_date": "2019-10-24 23:57:52",
        "update_date": "2019-10-24 23:57:52",
        "status": "1",
        "app_id": "3"
    },
    {
        "id": "2647989",
        "user_id": "355",
        "particular": "15 points debited from your wallet",
        "debit": "15",
        "credit": "0",
        "create_date": "2019-10-24 23:57:32",
        "update_date": "2019-10-24 23:57:32",
        "status": "1",
        "app_id": "3"
    }
}

谢谢。

0 个答案:

没有答案