Array ( [0] => Array ( [dateTime] => 2011-10-18 0:0:00 [chanl1] => 20.7
Use usort() function with custom comparator:
$arr = array(...); usort($arr, function($a, $b) { $ad = new DateTime($a['dateTime']); $bd = new DateTime($b['dateTime']); if ($ad == $bd) { return 0; } return $ad < $bd ? -1 : 1; });
DateTime class has overloaded comparison operators (<, >, ==).
<
>
==