I have this code:
$di = new RecursiveDirectoryIterator('MyPics');
foreach (new RecursiveIteratorIterator($di) as $filename => $file) {
echo '<figure class=masonry-brick><img src="'.$filename.'" alt=image class=masonry-img></figure>';
}
I want to make a pagination for this foreach
loop.
Note that all of the data is coming from a local folder (I'm not using MySQL) and the folder contains 7000+ pics.
How to make a pagination for this?