php编程,写一个函数,能够遍历一个文件夹下的所有文件和子文件夹
2013-07-24 00:06
609 查看
源代码:
function my_scandir($dir)
{
$files = array();
if ( $handle = opendir($dir) ) {
while ( ($file = readdir($handle)) !== false ) {
if ( $file != ".." && $file != "." ) {
if ( is_dir($dir . "/" . $file) ) {
$files[$file] = scandir($dir . "/" . $file);
}else {
$files[] = $file;
}
}
}
closedir($handle);
return $files;
}
}
源地址:http://www.techbzz.com/forum.php?mod=viewthread&tid=1492&extra=page%3D1
function my_scandir($dir)
{
$files = array();
if ( $handle = opendir($dir) ) {
while ( ($file = readdir($handle)) !== false ) {
if ( $file != ".." && $file != "." ) {
if ( is_dir($dir . "/" . $file) ) {
$files[$file] = scandir($dir . "/" . $file);
}else {
$files[] = $file;
}
}
}
closedir($handle);
return $files;
}
}
源地址:http://www.techbzz.com/forum.php?mod=viewthread&tid=1492&extra=page%3D1
相关文章推荐
- 写一个函数,能够遍历一个文件夹下的所有文件和子文件夹
- 写一个函数,能够遍历一个文件夹下的所有文件和子文件夹
- 一个php函数,能够遍历一个文件夹下的所有文件和子文件夹
- 写一个函数,能够遍历一个文件夹下的所有文件和子文件夹。
- 写一个函数能够遍历文件夹下的所有文件和文件夹
- PHP写一个函数,能够遍历一个文件夹下的所有文件和子文件夹。
- 3.写一个函数,能够遍历一个文件夹下的所有文件和子文件夹。
- 写出一个函数,能够遍历一个文件下的所有文件夹和子文件夹(新浪)
- (最明了)写一个函数,能够遍历一个文件夹下的所有文件和子文件夹。
- 遍历一个文件夹下的所有文件和子文件夹
- php 遍历一个文件夹下的所有文件和子文件夹
- 遍历一个文件夹下面所有的文件和子文件夹
- php写一个函数遍历文件夹下所有的文件和子文件
- 遍历一个文件夹下的所有文件和子文件夹
- c#遍历一个文件夹下的所有文件包括子文件夹
- c#遍历一个文件夹下的所有文件包括子文件夹
- c#遍历一个文件夹下的所有文件包括子文件夹【原】
- PHP遍历一个文件夹下所有文件和子文件夹的函数
- c#遍历一个文件夹下的所有文件包括子文件夹
- c#遍历一个文件夹下的所有文件包括子文件夹