Re-sorting newsfeed based on date
usort($sortArray, function($a, $b){
  return $a[0] - $b[0];
});

$sortArray = array_reverse($sortArray);


Minor thoughts:


Instead of sorting by $a[0]-$b[0] and reversing, why not sort by $b[0]-$a[0] in the first place? However...
You could just return $b[0] &lt;=&gt; $a[0].