suchen

Heim  >  Fragen und Antworten  >  Hauptteil

JSON-zu-PHP-Code? Bitte Gott um Erleuchtung

Der JSON lautet wie folgt:

{
    "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
}


Bitte fragen Sie die Master, ob Sie PHP zur Ausgabe dieses JSON verwenden möchten. Wie schreibe ich es?

BIN(๑•̀ㅂ•́)و✧BIN(๑•̀ㅂ•́)و✧646 Tage vor611

Antworte allen(4)Ich werde antworten

  • 靠近你深拥你

    靠近你深拥你2023-03-10 20:51:42

    试下这个 echo json_encode($result,JSON_UNESCAPED_UNICODE); 

    Antwort
    0
  • 入道人

    入道人2023-03-10 13:24:31

    这一段是json 数据  我们需要通过axios  方式 对这个json 文件进行读取 response.pageList.colList    然后在控制台输出 就行 php 就使用php 语法输出 js 就使用js 语法输出

    Antwort
    0
  • 大瓶可乐@php.cn

    大瓶可乐@php.cn2023-03-02 15:37:29

    输出是什么意思 是取出json里面的数据吗?

    是的可以 json_decode

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

    我用ChatGPT OK

    BIN(๑•̀ㅂ•́)و✧ · 2023-03-02 15:39:47
  • StornierenAntwort