复制代码代码如下:
function read_all_dir ( $dir )
{
$result = array();
$handle = opendir($dir);
if ( $handle )
{
while ( ( $file = readdir ( $handle ) ) !== false )
{
if ( $file != '.' && $file != ')
{
$cur_path = $dir 。 DIRECTORY_SEPARATOR 。 $file;
if ( is_dir ( $cur_path ) )
{
$result['dir'][$cur_path] = read_all_dir ( $cur_path );
}
else
{
$result['file'][] = $cur_path;
}
}
}
closeir($handle);
}
return $result;
}
?>
http://www.bkjia.com/PHPjc/327951.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/327951.html技術記事例: ?php function read_all_dir ( $dir ) { $result = array(); $handle = opendir($dir); if ( $handle ) { while ( ( $file = readdir ( $handle ) ) !== false ) {...