php 显示指定路径下的图片
2009-10-29 00:00
417 查看
function getAllDirAndFile($path) { if(is_file($path)) { if(isImage($path)) { $str=""; $str.='<table style="border:solid 1px blue;" width="95%">'; $str.="<tr>"; $path=iconv("gb2312","utf-8",$path); $str.="<td width=80%>".$path."</td><td width=15%><img src=".$path." style='width:50px;height:50px;'></td>"; $str.="</tr>"; $str.="</table>"; echo $str; } } else { $resource=opendir($path); while ($file=readdir($resource)) { if($file!="." && $file!="..") { getAllDirAndFile($path."/".$file); } } } } function isImage($filePath) { $fileTypeArray=array("jpg","png","bmp","jpeg","gif","ico"); $filePath=strtolower($filePath); $lastPosition=strrpos($filePath,"."); $isImage=false; if($lastPosition>=0) { $fileType=substr($filePath,$lastPosition+1,strlen($filePath)-$lastPosition); if(in_array($fileType,$fileTypeArray)) { $isImage=true; } } return $isImage; }
相关文章推荐
- php 显示指定路径下的图片
- php获取文件夹路径内的图片以及分页显示示例
- php上传图片到指定位置路径保存到数据库的具体实现
- 将指定路径的图片,显示在android系统相册中
- php上传图片到指定位置路径保存到数据库的具体实现
- php上传图片到指定位置路径保存到数据库的具体实现
- asp将base64的图片信息,转为图片显示,并保存到指定路径
- 从指定的路径中读取图片,并显示出来
- php随机显示指定文件夹下图片的方法
- php上传图片到指定位置路径保存到数据库
- PHP上传图片 检查并保存到指定路径
- php随机显示指定文件夹下图片的方法
- 如何在web项目中使用jfreechart和显示硬盘上指定路径上的图片
- Android--显示指定路径的图片
- php获取文件夹路径内的图片以及分页显示示例
- HttpHandler:给指定路径下的图片添加水印显示
- 图片大于指定宽度时缩放显示,否则正常显示
- PHP显示图片
- python 在指定网址下载图片并显示
- php 随机显示图片的函数(实例)