|
|
|
图片直读代码
编辑: 来源: 日期:2008-02-06 我要投稿
家园 |
|
保存为index.php放在你的图片目录里面。
PHP源码: <? $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); /****************************************************/ ?>
上一篇:一个用PHP写的中文分词函数 下一篇:PHP的模板
|
|
|
|
【文章评论】
【收藏本文】
【推荐好友】
【打印本文】
【论坛讨论】 |
相关文章: |
|
 |
文章评论:(0条) |
|
|
|
|
责任编辑:IT学院 声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。 |
|