Created
August 22, 2018 05:15
-
-
Save chakravarthykalyan90/27ddafc57c9d65cd788ff0fea224cc84 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
$dir = "/var/www/html/location/"; | |
chdir($dir); | |
array_multisort(array_map('filemtime', ($files = glob("*.*"))), SORT_ASC, $files); | |
foreach($files as $filename) | |
{ | |
echo "<li>".substr($filename, 0, -4)."</li>"; | |
rename($filename, '/var/www/html/location/archive/'.$filename); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment