Was ist die bequeme Möglichkeit, Objekte in Arrays umzuwandeln? Originaldaten?
$data = {
"1": {
"id": 1,
"name": "超市类",
"pid": 0,
},
"3": {
"id": 3,
"name": "餐饮类",
"pid": 0,
},
"4": {
"id": 4,
"name": "造型类",
"pid": 0,
},
}
$data = [{
"id": 1,
"name": "超市类",
"pid": 0,
},{
"id": 3,
"name": "餐饮类",
"pid": 0,
},{
"id": 4,
"name": "造型类",
"pid": 0,
}]
我认为原始数据是json,所以
一个很笨的方法(array)$data,这个其实也可以