I'm currently messing around with Twitter API, but this question isn't really related to Twitter API; it's just a general PHP question.
I'm pulling a couple queries of Tweets separately and then merging the requests together. And so, basically, I'm ending up with a final array something like this at the end of it all, where the Tweets aren't necessarily in the correct chronological order:
$tweets = array(
array(
'text' => 'Some tweet.',
'time' => 'Sat Jun 22 00:45:37 +0000 2013'
),
array(
'text' => 'And another.',
'time' => 'Fri Jun 21 15:32:34 +0000 2013'
),
array(
'text' => 'Another tweet.',
'time' => 'Fri Jun 21 17:24:44 +0000 2013'
),
array(
'text' => 'And one more tweet.',
'time' => 'Fri Jun 21 08:01:37 +0000 2013'
)
);
And now I'm just trying to figure out what the best way to sort this array by the timestamp of each Tweet is, in descending order.
I'm reading about usort
and uasort
but I'm not just quite understanding them, along with how they would correspond to using this timestamp as a comparison. So any help here would really be appreciated. Thanks in advance!