 |
图片直读代码,保存为index.php放在图片文件夹里 |
热 ★★★★ |
| 图片直读代码,保存为index.php放在图片文件夹里 |
|
作者:未知 文章来源:老枪论坛 点击数: 更新时间:2004-11-20 20:56:20  |
<? $imgtype=array(bmp,jpg,jpeg,png,gif); /****************************************************/ $imgtype_count=count($imgtype); $path="."; $handle=opendir($path); while ($file = readdir($handle)){
if (is_dir($file)) {continue;} $type = explode(".",$file); $type = $type[1];
for($i=0;$i<$imgtype_count;$i++){ if($type==$imgtype[$i]){echo"<a href=".$path."/".$file." target=\"_blank\" alt=\"点击打开新窗口浏览\"><img src=".$path."/".$file." border=\"0\" onload=\"if(this.height>150) {this.height=150;this.width=150*this.width/this.height;}\"></a>\n";} } } closedir($handle); /****************************************************/ ?> |
| 文章录入:admin 责任编辑:admin |
|
上一篇文章: PHP中的面向对象和面向过程
下一篇文章: Php自动生成html的文本论坛源代码 |
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |