Created
July 18, 2010 20:32
-
-
Save lukegb/480686 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 = 'news'; | |
$nstuffa = scandir($dir); | |
$nstuff = array(); | |
foreach ($nstuffa as $nitem) { | |
if ($nitem == '.' || $nitem == '..') continue; | |
$nstuff[$nitem] = filectime($dir.'/'.$nitem); | |
} | |
arsort($nstuff, SORT_NUMERIC); | |
$ncount = 0; | |
foreach ($nstuff as $nitem => $ntime) { | |
$thelist .= '<li><a href="/'.$dir.'/'.$nitem.'">'.$nitem.'</li></a>'; | |
if (++$ncount >= 5) | |
break; | |
} | |
echo $thelist; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is great!