【发布时间】:2011-10-04 02:27:04
【问题描述】:
有人可以帮我吗...我已经阅读了以前的 PHP '排序'问题...并尝试遵循逻辑...但是大脑衰退盛行;-!
我有一个 json 对象(来自 facebook),我正在尝试使用以下代码使用其中一个值('created_time')对其进行排序:
$json = file_get_contents($url,0,null,null);
$result = json_decode($json, true);
array_multisort($note['created_time'], SORT_ASC, $result); /* what's wrong with this line?? */
下图示例json数据:
{
"data": [
{
"id": "123",
"from": {
"name": "Example",
"category": "Musician/band",
"id": "123"
},
"subject": "Subject 1",
"message": "Example message text 1",
"created_time": "2011-07-12T20:18:17+0000",
},
{
"id": "123",
"from": {
"name": "Example",
"category": "Musician/band",
"id": "123"
},
"subject": "Subject 2",
"message": "Example message text 2",
"created_time": "2011-07-12T20:21:01+0000",
},
...
感谢您的帮助。
【问题讨论】: