I have the following code:
<?php
$files = array_merge(glob("*.jpg"), glob("*.JPG"),
glob("*.JPEG"), glob("*.jpeg"));
array_multisort(
array_map( 'filemtime', $files ),
SORT_DESC,
$files
);
//simple foreach loop
foreach($files as $photo) {
//replace thumbnails to thumbnails directory
$thumbnail = str_replace('.', '.', $photo);
echo '<li><a href="'.$photo.'"><img src="'.$thumbnail.'" alt=" " width="120" height="120" /></a></li>';
}
?>
I would like to add pagination to it that it will show certain amount of photos per page.
Thanks in advance,
Amir


Sign In
Create Account


Back to top










