Answers for "date sort in php"

PHP
0

order by date wp php

$query = new WP_Query(array(
    'post_status' => 'publish',
    'orderby' => 'publish_date',
    'order' => 'DESC'
  ));
//DESC sorts by newest, ASC by oldest. GL fellow grepper user
Posted by: Guest on October-19-2020
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
0

php sort time

strtotime();
Posted by: Guest on January-25-2021

Browse Popular Code Answers by Language