我正在尝试以以下特定格式获取一个 json 文件。
{
"business":[
{
"id":"13",
"category":"Dinner",
"subcategory":"",
"name_eng":"dinner 1",
"name_arab":"dinner 1",
"mobile":"12345",
"address":"not now",
"logo":"1.gif",
"contact":"Call",
"open_time":"10 PM",
"close_time":"8 PM"
}
],
"business_cat":[
[
"cat 1",
{
"name":"dish 1",
"id":"7",
"name_arab":"dish1",
"desc_eng":"5 Chicken Legs\r\n5 Hamous\r\n5 Fires\r\n5 Pepsi",
"desc_arab":"5 Chicken Legs\r\n5 Hamous\r\n5 Fires\r\n5 Pepsi",
"price":"200 KD",
"logo":"laptop.jpeg"
},
{
"name":"dish 2",
"id":"8",
"name_arab":"dish 2",
"desc_eng":"5 Chicken Legs\r\n5 Hamous\r\n5 Fires\r\n5 Pepsi",
"desc_arab":"5 Chicken Legs\r\n5 Hamous\r\n5 Fires\r\n5 Pepsi",
"price":"123789",
"logo":"micky.jpg"
},
{
"name":"dish3",
"id":"13",
"name_arab":"dish3",
"desc_eng":"5 Chicken Legs\r\n5 Hamous\r\n5 Fires\r\n5 Pepsi",
"desc_arab":"5 Chicken Legs\r\n5 Hamous\r\n5 Fires\r\n5 Pepsi",
"price":"300 KD",
"logo":"1.jpg"
},
{
"name":"new dish",
"id":"15",
"name_arab":"new dish",
"desc_eng":"5 Chicken Legs\r\n5 Hamous\r\n5 Fires\r\n5 Pepsi",
"desc_arab":"5 Chicken Legs\r\n5 Hamous\r\n5 Fires\r\n5 Pepsi",
"price":"213 KD",
"logo":"12.jpg"
}
],
[
"cat2",
{
"name":"dish3",
"id":"14",
"name_arab":"dish3",
"desc_eng":"5 Chicken Legs\r\n5 Hamous\r\n5 Fires\r\n5 Pepsi",
"desc_arab":"5 Chicken Legs\r\n5 Hamous\r\n5 Fires\r\n5 Pepsi",
"price":"123 KD",
"logo":"10.jpg"
},
{
"name":"dish 4",
"id":"16",
"name_arab":"dish4",
"desc_eng":"5 Chicken Legs\r\n5 Hamous\r\n5 Fires\r\n5 Pepsi",
"desc_arab":"5 Chicken Legs\r\n5 Hamous\r\n5 Fires\r\n5 Pepsi",
"price":"110 KD",
"logo":"3.jpg"
}
]
]
}
现在我如何访问“business”、“business_cat”和“business_cat”、“cat 1”和“cat 2”名称以及“cat 1”和“cat 2”中的所有对象。请这对我来说处理这样的json数据有点复杂,帮帮我。