我有这个脚本:
<?php
if ($handle = opendir('konten')) {
$blacklist = array('.', '..', 'somedir', 'index.php', 'style.css');
while (false !== ($file = readdir($handle))) :
if (!in_array($file, $blacklist)) :
?>
<div style="display:block;clear:both;">
<span style="font-size:18px;">»</span> <a href=""><?php echo $file;?></a>
</div>
<?php
endif;
endwhile;
closedir($handle);
}
?>
输出如下所示:
» linux (5th copy)
» linux
» linux (10th copy)
» linux (9th copy)
» linux (4th copy)
» linux (6th copy)
» linux (8th copy)
» linux (copy)
» linux (7th copy)
» linux (another copy)
» linux (3rd copy)
如何为其添加分页?
例如:我只想在一页上显示 3 个目录。