php目录遍历函数opendir用法实例

浏览:1175 发布日期:2017/02/08 分类:技术分享
<?php  

$dir = "./"; 

 

// open a known directory, and proceed to read its contents  

if (is_dir($dir))  

{  

if ($dh = opendir($dir)) {  

while (($file = readdir($dh)) !== false) {  

echo "filename: $file : filetype: " . filetype($dir . $file) . "n"."<br />";  

}

closedir($dh);  

}  

}  

?>
最佳答案
评论( 相关
后面还有条评论,点击查看>>