php array order by date
snippet in php

php array order by date

user9848

usort($array, function($a, $b) {
  return new DateTime($a['datetime']) <=> new DateTime($b['datetime']);
});