I would like to add a simple pagination system to my music player on my site and i am not really sure how to go about it. I have done pagination systems for results from mysql but not when pulling files from a directory.
Don’t need anything super fancy just a simple previous and next links if there is a next or previous page, and only 10 mp3s per page.
Here is my code:
[php]<?php
$dir = “mp3/*”;
// Open a known directory, and proceed to read its contents
foreach(glob("$dir{*.mp3}", GLOB_BRACE) as $file)
{
echo ‘
}
?>[/php]