首頁  >  文章  >  後端開發  >  顯示器驅動程式已停止回應 並且已成功恢復 php 顯示指定路徑下的圖片

顯示器驅動程式已停止回應 並且已成功恢復 php 顯示指定路徑下的圖片

WBOY
WBOY原創
2016-07-29 08:41:011502瀏覽

複製程式碼程式碼如下:


function getAllDirAndFile($path)
{
if(is_file($path))
{
if(isImage($path))
{
$str="";
$str.='';
$str.="

";
$path=iconv("gb2312","utf-8",$path);
$str.="".$path." 顯示器驅動程式已停止回應 並且已成功恢復 php 顯示指定路徑下的圖片」;
$str.="";
$str.="";
回顯$str;
}
}
其他
{
$resource=opendir($path);
while ($file=readdir($resource))
{
if($file!="." && $file!=". .")
{
getAllDirAndFile($路徑."/".$file);
}
}
}
}
function isImage($Path)
}
function isImage($Path)
{
$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教程有興趣的朋友有所幫助。 🎜>

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn