PHP

디렉토리 읽기

커피향이 좋아! 2009. 9. 9. 11:32
$path ="./gallery";
function DIRs( $path ){
 $fp = opendir($path);
 while( $fr = readdir( $fp ) ){
  if( "." == $fr or ".." == $fr ) continue;
  else if ( is_file( $path."/".$fr ) ){
         
  //echo "<span ><img src='/gallery/$fr' width=120 height=100></span>";
        continue;
    }
    else {
    $sub = $path."/".$fr;
   
    DIRs( $sub );
   
    }
 
  }
  closedir( $fp );
  }
DIRs($path);