我有這樣的代碼,顯示內部「圖片」目錄中的所有圖像,但它是非常惱人的,因爲所有的圖像都顯示在一個頁面上:/分支圖像結果分成多頁
我怎麼能在分割這些圖像多個頁面?
這裏是代碼
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
</head>
<?php
$files = glob("images/*.*");
echo '<div id="design">';
for ($i=0; $i<count($files); $i++) {
$num = $files[$i];
if ($i%3==0){echo '<div class="Row">';}
echo '<img class="img" width="250px" height="250px" src="'.$num.'" alt="random image" />';
if ($i%3==0){echo '</div>';}
}
echo '</div>';
?>
看看分頁:http://phpeasystep.com/phptu/29.html – 2012-03-31 13:51:58