i need help in pagination

Hi every one thanks for this forum
any body can help me how i can add pagination to this file and list directory by last added
[php]

<?php $gr = "music/Musique-Maghreb/"; $gr="music/$cat/"; $rep=opendir($gr); $c=1; while ($file = readdir($rep)){ if($file != '..' && $file !='.' && $file !=''){ if (file_exists("images/$file.jpg")) { $img="images/$file.jpg"; } else { $img="images/nophoto.jpg"; } if ($c==1) { echo ""; } ?> <?php echo $file;?>
<?php if($c==5) { echo ""; $c=0; } $c++; } }

closedir($rep);
clearstatcache();
?>

[/php]

Collect filemtime($file)
Sort using array multi-sort:
http://shiflett.org/blog/2011/jun/sorting-multi-dimensional-arrays-in-php

Using scandir instead of opendir you can specify sort
http://php.net/manual/en/function.scandir.php

You might want to look at using recursive directory editor

Sponsor our Newsletter | Privacy Policy | Terms of Service