";
?>
30, // how many item to display for each page
'around' => 7, // how many page btn to show around the current page btn
'directory' => './p', // dir to scan for items
);
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$offset = ($page - 1) * $options['quantity']; // $page base index is 1
$filelist = array_diff(scandir($options['directory']), array('..', '.'));
//get subset of file array
$selectedFiles = array_slice($filelist, $offset, $options['quantity']);
foreach ($selectedFiles as $file) {
$path = $options['directory'] . '/' . $file;
$link = " $file ";
echo $link;
}
?>