我该怎么做才能将变量数组的两个维度更改为对象。 我用Angularjs写作
[Object, Object, Object]
0:Object
Amount :12
categoryID:"1"
typeID:"1"
typeName:"chicken"
1:Object
Amount :23
categoryID:"1"
typeID:"4"
typeName:"Bird"
2:Object
Amount :12
categoryID:"1"
typeID:"5"
typeName:"swan"
要:
{
0:{
Amount :12
categoryID:"1"
typeID:"1"
typeName:"chicken"
}
1:{
Amount :23
categoryID:"1"
typeID:"4"
typeName:"Bird"
}
2:{
Amount :12
categoryID:"1"
typeID:"5"
typeName:"swan"
}
}
我想用它来发送数据json_encode。 帮我解决一下。