I am having trouble seeing why this will not sort the list using rsort to get the list sorted in reverse... I also need to find a way to sort it for filemtime() any ideas for that as well (so the last modified file shows on top)?
Thanks
PHP Code:
<?php
$filelist = scandir('c:/test/');
$files = array();
foreach($filelist as $file){
if(strpos($file,'.')!==0){
array_push($files, $file);
}
}
$pages = array_chunk($files, '10');
$page = (int)$_GET['page'];
$pages[$page];
for($i = 1; $i < count($pages) +1; $i++) {
?>
<a href="?page=<?php echo $i;?>"><?php echo $i; ?></a><br />
<?php
}
rsort($pages);
foreach($pages[$page-1] as $file) {
echo $file . "<BR />";
}
Bookmarks