copy code code as follows:
function bdir($dir,$typearr){
$ndir = scandir($dir) ;
foreach ($ndir as $k => $v){
if ($v == '.' || $v == '..'){
continue;
}
if (filetype($dir.$v) == 'file'){
$arr = explode('.',$v);
$type = end($arr);
if (in_array($type,$typearr)){
echo $dir.$v."
";
}
}elseif (filetype($dir.$v) == 'dir'){
//echo $dir.$v."
";
bdir($dir.$v.'/',$typearr);
}
}
}
$dir ='e:/ddcms/';
$typearr = array('htm','html','php');
bdir($dir,$typearr);
http://www.bkjia.com/PHPjc/319484.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319484.htmlTechArticle copy the code code below: function bdir($dir,$typearr){ $ndir = scandir($dir); foreach ($ndir as $k = $v){ if ($v == '.' || $v == '..'){ continue; } if (filetype($dir.$v) == 'file...