<?php
function read_all_dir ( $dir )
{
$result = array();
$handle = opendir($dir);
if ( $handle )
{
while ( ( $file = readdir ( $handle ) ) !== false )
{
if ( $file !=
{
$cur_path = $dir
if ( is_dir ( $cur_path ) )
{
$result[
}
else
{
$result[
}
}
}
closedir($handle);
}
return $result;
}
?>
From:http://tw.wingwit.com/Article/program/PHP/201311/21006.html