In Codeigniter I am creating an array and returning it to the user. I am creating the array like this (result is the return form a DB query):
array("email" => $result)
Right now it outputs:
"email": [
{
"id": "629",
"desc": "0000",
"value_1": "0000",
"value_2": null,
"value_3": null,
"value_4": null,
"privacy": "0"
}
]
So $result
is an array that contains a single object. How can I make $result
contain just the object instead? Like this:
"email": {
"id": "628",
"desc": "THIS IS IT",
"value_1": "THIS IS IT2",
"value_2": null,
"value_3": null,
"value_4": null,
"privacy": "0"
}
Thankful for all input!