Can someone help me please ... I've read previous PHP 'sorting' questions ... and tried to follow the logic ... but brain fade prevails ;-!
I have a json object (from facebook) which I am trying to sort using one of the values ('created_time') using the following code:
$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?? */
Example json data shown below:
{
"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",
},
...
Thanks for you help.