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"}
},
];
I want to construct a multidimensional array which after ecoding using json_encode() function in php should give me the output in above mentioned json format.
How the multidimensional array should look like?