JSON 轉 PHP程式碼?求大神賜教~
BIN(๑•̀ㅂ•́)و✧
BIN(๑•̀ㅂ•́)و✧ 2023-02-28 11:55:29
0
4
614

JSON如下:

{
    "pageList":{
        "pageCount":1,
        "curPage":1,
        "rowsCount":1,
        "colList":[
            {
                "colEnName":"id"
            },
            {
                "showName":"true",
                "colZhName":"供应商名称",
                "widgetType":"textWidget",
                "colEnName":"gysmc"
            },
            {
                "colZhName":"备注",
                "widgetType":"textAreaWidget",
                "colEnName":"bz"
            },
            {
                "colZhName":"金额",
                "widgetType":"moneyWidget",
                "colEnName":"money"
            },
            {
                "colZhName":"总人数",
                "widgetType":"numberWidget",
                "colEnName":"number"
            },
            {
                "colZhName":"入住日期",
                "dateFormat":"yyyy-MM-dd",
                "widgetType":"dateWidget",
                "colEnName":"rzrq"
            },
            {
                "colZhName":"入住具体时间",
                "dateFormat":"yyyy-MM-dd HH:mm",
                "widgetType":"dateWidget",
                "colEnName":"rzjtsj"
            },
            {
                "colZhName":"入住年月",
                "dateFormat":"yyyy-MM",
                "widgetType":"dateWidget",
                "colEnName":"rzny"
            }
        ],
        "dataList":[
            {
                "number":"2100000",
                "rzrq":"2017-11-17",
                "gysmc":"供应商名称",
                "money":"549771.0",
                "rzny":"2017-11",
                "bz":"备注信息10",
                "rzjtsj":"2017-11-17 08:00",
                "id":"10"
            }
        ]
    },
    "error":null,
    "errorCode":0,
    "success":true
}


請問大神們,想用PHP輸出這個JSON。要怎麼寫?

BIN(๑•̀ㅂ•́)و✧
BIN(๑•̀ㅂ•́)و✧

全部回覆(3)
靠近你深拥你

試下這個 echo json_encode($result,JSON_UNESCAPED_UNICODE); 

失忆孤独患者

這一段是json 資料  我們需要透過axios  方式 對這個json 檔案進行讀取 response.pageList.colList    然後在控制台輸出 就行 php 就使用php 語法輸出 js 就使用js 語法輸出

大瓶可乐@php.cn

輸出是什麼意思 是取出json裡面的資料嗎?

是的可以 json_decode

#
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板