Created
January 20, 2014 08:54
-
-
Save csalgueiro/8516997 to your computer and use it in GitHub Desktop.
Glob: Ordenar por fecha
From http://stackoverflow.com/questions/124958/glob-sort-by-date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Obtener el array | |
$myarray = glob("*.*"); | |
// Ordenar por fecha ascendente | |
usort($myarray, create_function('$a,$b', 'return filemtime($a) - filemtime($b);')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment