可能重复:
PHP and Codeigniter. How to return an array object and not plain array?
我被困在这里。
这有什么不同:
"email": {
"id": "628",
"desc": "THIS IS IT",
"value_1": "THIS IS IT2",
"value_2": null,
"value_3": null,
"value_4": null,
"privacy": "0"
}
而且:
"email": [
{
"id": "629",
"desc": "0000",
"value_1": "0000",
"value_2": null,
"value_3": null,
"value_4": null,
"privacy": "0"
}
]
如何让第二个看起来像第一个?
更新
我在Codeigniter中创建这样的数组:
array("email" => $result).
我怎样才能把它变成对象?