employees = [
{
"firstName":"John",
"lastName":"Doe",
"sub":[{"sub_name":"subcat1"},
{"sub_name":"subcat2"}
]
},
{
"firstName":"Anna",
"lastName":"Smith",
"sub":[{"sub_name":"subcat3"},
{"sub_name":"subcat4"}
},
{
"firstName":"Peter",
"lastName":"Jones",
"sub":[{"sub_name":"subcat5"},
{"sub_name":"subcat6"}
},
];
我想构建一个多维数组,在使用php中的json_encode()函数进行ecoding后,应该给我输出上面提到的json格式。
多维数组应该如何?
答案 0 :(得分:1)
要从你所拥有的json向后工作,请运行var_export(json_decode($json, true))
并查看它给你的数组。