PHP
·
发表于 5年以前
·
阅读量:8298
дһ¸oPHPº¯Êý£¬ÊµÏÖɨÃe²¢´oÓ¡³o×Ô¶¨Ä¿Â¼ÏÂ(º¬×ÓĿ¼)µÄËuÓÐjpgÎļþÃuµÄ½¨
<?php
$dir = "E:\ÕÕƬ\\";
//´oÓ¡Îļþ¼ÐÖÐËuÓÐjpgÎļþ
function printJpg($dir,$deep = ""){
$dirSource = dir($dir);
while($d = $dirSource->read()){
if($d == "." || $d == ".."){
continue;
}
if(filetype($dir.$d) == "dir"){
printJpg($dir.$d."/",$deep."--");
}
if(mime_content_type($dir.$d) == "image/jpeg"){
echo $deep.$d."<br/>";
}
}
}
printJpg($dir);
Õa¸oº¯ÊýÔÚÎÒ±¾µØÔËÐеÄʱºo»Ø³¬Ê±£¬¿ÉÄÜÊÇÎÒ±¾µØͼƬÓеa¶a£¬ºÃ¼¸Ê®GͼƬ¡£
ÒÔÉÏÕaƪphpдһ¸oº¯Êý,ʵÏÖɨÃe²¢´oÓ¡³o×Ô¶¨Ä¿Â¼ÏÂ(º¬×ÓĿ¼)ËuÓÐjpgÎļþÃu¾ÍÊÇС±a*ÖÏi¸ø´o¼ÒµÄÈ«²¿ÄÚÈÝÁË£¬Ï£ÍuÄܸø´o¼ÒÒ»¸o²Î¿¼£¬Ò²Ï£Íu´o¼Ò¶a¶aÖ§³Ö½Å±¾Ö®¼Ò¡£