×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: userc865b
Added: Sep 17, 2019 2:34 PM
Views: 4074
Tags: php
  1. $data = array(
  2.     '05.08.2019',
  3.     '14.07.2019',
  4.     '21.07.2019',
  5.     '24.06.2019',
  6.     '25.08.2019',
  7.     '29.07.2019'
  8.  
  9. );
  10.  
  11. function sortFunction( $a, $b ) {
  12.  
  13.     return  strtotime($b)-strtotime($a);
  14. }
  15. usort($data, "sortFunction");
  16. VAR_DUMP($data);