Changeset 8753 for temp


Ignore:
Timestamp:
2006/11/21 14:56:56 (20 years ago)
Author:
uehara
Message:

blank

File:
1 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/html/test/uehara/test.php

    r8752 r8753  
    44$cnt = 0; 
    55print_r(sfGetFileTree("/home/web/test.ec-cube.net/html/user_data/")); 
    6  
     6/* 
    77function sfGetFileTree($dir) { 
    88    global $arrTree; 
     
    2727    return $arrResult; 
    2828} 
     29*/ 
     30 
     31function sfGetFileTree($dir) { 
     32    $arrResult = array(); 
     33    if(file_exists($dir)) { 
     34        // ¥Ç¥£¥ì¥¯¥È¥ê¤«¥Á¥§¥Ã¥¯ 
     35        if (is_dir($dir)) { 
     36            if ($handle = opendir("$dir")) { 
     37                $cnt = 0; 
     38                while (false !== ($item = readdir($handle))) { 
     39                    if ($item != "." && $item != "..") { 
     40                        if (is_dir("$dir/$item")) { 
     41                            sfGetFileTree("$dir/$item"); 
     42                        } else { 
     43                            $arrResult[$cnt]['file_name'] = "$dir/$item"; 
     44                        } 
     45                    } 
     46                    $cnt++; 
     47                } 
     48            } 
     49            closedir($handle); 
     50            $arrResult[$cnt]['file_name'] = "$dir/$item"; 
     51        } 
     52    } 
     53 
     54    return $arrResult; 
     55} 
     56 
    2957 
    3058?> 
Note: See TracChangeset for help on using the changeset viewer.