Looking at the object array below, it's clear that the size and members of the array can vary. So, how can I efficiently convert all this data into a JSON object?
Array:
[0] =>{ "Name": XYZ }
[1] =>{ "Gender":M }
[2] =>{ "DOB":09085672 }
[3] =>{ "City":London }
[4] =>{ "State":UK}
[5] =>{ "County":Chester }
JSON Output:
{
"Name":XYZ,
"Gender": M,
"DOB" : 09085672,
"City":London,
"State": UK,
"County":Chester
}