0
我有这样的脚本:执行opendir()支持分页
<?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个dirs。
这就是工作,如果我例如设置网址到极限= 4&页= 1?。但如何显示分页链接? sory im noob in php like this – Anggagewor
@AnggaMovic的帖子已更新。但是你需要在代码末尾更改cicle的URL。只有一个只有查询的临时网址。也有更新开始 - 没有更多的动态限制支持:) – Spell