来自目录的图像具有分页,图像大小调整等

来自目录的图像具有分页,图像大小调整等

问题描述:

您好我正在尝试在下面的脚本中显示10个图像后在页面底部设置分页,但不知道从哪里开始以及如何将其实现到脚本中。



我还需要一些帮助来制作一个规则,图像应该显示不大于800 x 600和。



最后我收到一行显示& nbsp在页面底部,我不知道如何删除它...



Hi I'm trying to setup Pagination at the bottom of the page after showing 10 images in the following script but have no clue where to start and how to implement it into the script.

I also need some help to make a rule where images should show not bigger than 800 x 600 and.

Lastly I receive a line showing &nbsp at the bottom of the page and I have no Idea how to remove it...

<!DOCTYPE html> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html"> 
<title>Show images in folder</title> 
<link rel="stylesheet" type="text/css" href="style.css"> 
</head> 
<body> 
<br> 
<?php 
date_default_timezone_set("Africa/Harare"); 
$folder = 'img/'; 
$filetype = '*.*'; 
$files = glob($folder.$filetype); 
$count = count($files); 

$sortedArray = array(); 
for ($i = 0; $i < $count; $i++) { 
    $sortedArray[date ('YmdHis', filemtime($files[$i])) . $i] = $files[$i]; 
} 

ksort($sortedArray); 
# krsort($sortedArray); 

echo '<table>'; 
foreach ($sortedArray as &$filename) { 
    echo '<tr><td>'; 
    echo '<a name="'.$filename.'" <br><img src="'.$filename.'" /></a>'; 
echo '<br>'; 
    echo substr($filename,strlen($folder),strpos($filename, '.')-strlen($folder)); 
    echo '</td></tr>'; 
} 
echo '</table>'; 
?>

文件夹 = ' img /';
folder = 'img/';


filetype = ' * *'跨度>。
filetype = '*.*';


files = glob(
files = glob(