文件显示值显示一个文件(文件类型都是RAR)
<?php
//打开指定目录
function readDirectory($path) {
$handle = opendir ( $path );
while ( ($item = readdir ( $handle )) !== false ) {
//.和..这两个特殊目录
if ($item != "." && $item != "..") {
if (is_file ( $path . "/" . $item )) {
$arr ['file'] [] = $item;
}
if (is_dir ( $path . "/" . $item )) {
$arr ['dir'] [] = $item;
}
}
}
closedir ( $handle );
return $arr;
}
?>