Why does the JSON output show both the index number and the association colume name?
I only need just column name such as "UID"
PHP CODE
$res = $statement->fetchAll();
$records = array('Record'=>$posts);
echo json_encode($records);
JSON OUTPUT
{
"Record":[
{
"UID":"1001",
"0":"1001",
"NAME":"Robot2",
"1":"Robot2",
"EMAIL":"robot2@test.com",
"2":"robot2@test.com",
"GENDER":"f",
"3":"f"
},
{
"UID":"1030",
"0":"1030",
"NAME":"Anna",
"1":"Anna",
"EMAIL":"Anna@msn.com",
"2":"Anna@msn.com",
"GENDER":"f",
"3":"f"
}
]
}
Thanks