如何将此JSON转换为PHP

如何将此JSON转换为PHP,php,json,Php,Json,您好,我想将此JSON转换为PHP: data = { rows: [{ id: 1001, data: ["100", "A Time to Kill", "John Grisham", "12.99", "1", "05/01/1998"] }, { id: 1002, data: ["1000", "Blood and Smoke", "Stephen King", "0", "1", "01/01/2000"] }] } 有什么建

您好,我想将此JSON转换为PHP:

data = {
rows: [{
    id: 1001,
    data: ["100", "A Time to Kill", "John Grisham", "12.99", "1", "05/01/1998"]
    }, {
    id: 1002,
    data: ["1000", "Blood and Smoke", "Stephen King", "0", "1", "01/01/2000"]
    }]
    }
有什么建议吗

经过几个小时的思考,我终于解决了这个问题

$data.='
 {id:'.$rows['ID'].',
       data:["'.$rows['Price'].'","'.$rows['Title'].'","'.$rows['author'].'","'.$rows['date'].'"]
       },';

这就是我转换的意思:)

是您的朋友。

您应该在php中使用一些json解析器,并将json数据映射到某个对象;您可以使用(记住json是数据结构,但php是一种编程语言(实际上是脚本),因此将json转换为php毫无意义。)

您将其转换为php是什么意思?-1由于缺乏研究,首先点击google(json转换为php)可以找到答案。评论功能是您的朋友。