给一个路径,得到她下面的图片,并显示出来
来源:互联网 发布:开通淘宝客要求 编辑:程序博客网 时间:2024/04/29 18:52
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;
}
- 给一个路径,得到她下面的图片,并显示出来
- 从指定的路径中读取图片,并显示出来
- 在html页面用ajax的简单应用通过javascript得到数据库中的图片路径并在表格中显示出来
- 在HTML中使用动态变量获取数据库路径的图片,并显示出来。
- Android将指定文件路径下的图片显示出来
- 有关拍照并获取图片显示出来的问题
- 获取网页中的图片并显示出来
- 将图片写入数据库并显示出来
- js file上传图片并显示出来
- 得到图片字节流 用bitmap显示出来
- #.图片路径是汉字,导致图片显示不出来,解决方法
- 读取input:file的路径并显示本地的图片
- 获取sd卡某路径下的图片,并展示出来
- php上传图片得到路径给表单字段赋值的通用方法
- php上传图片得到路径给表单字段赋值的通用方法
- 在安卓中img的路径有汉字 图片是不显示出来的
- FileUpload 控件得到图片路径后即时显示图片
- 关于图片文件src路径有空格显示不出来的问题
- jar包打包成exe文件
- C#教学第20讲字符2(学习笔记)
- 一般人不会知道的Sql语句,你会么?
- 手机今天在公车站被偷了
- 做人做事是一门艺术,更是一门学问
- 给一个路径,得到她下面的图片,并显示出来
- C++
- 数据库连接大全
- OpenGL系统设计-纹理贴图(2)
- 隆重开博!
- oracle表空间碎片整理
- 很高兴加入CSDN
- 如何显示和隐藏任务栏
- OpenGL系统设计-显示列表(2)