Answers for "how to sort date and time in descending order php in array"

PHP
2

php array order by date

usort($array, function($a, $b) {
  return new DateTime($a['datetime']) <=> new DateTime($b['datetime']);
});
Posted by: Guest on January-09-2020

Code answers related to "how to sort date and time in descending order php in array"

Browse Popular Code Answers by Language