웹마스터 팁

// 오픈할 디렉토리 패스
$dir_path = "./";

// 디렉토리를 연다.
$dir_handle = opendir($dir_path);

// 전체 디렉토리 내용을 출력한다.
while($tmp = readdir($dir_handle))
{

        echo (is_dir($dir_path.$tmp) ? "디렉토리 : $tmp<br>" : "파일 : $tmp<br>";
}

출력 결과
-------------------------------------
디렉토리 : .
디렉토리 : ..
파일 : index.php
디렉토리 : 80port
디렉토리 : zb
디렉토리 : test
디렉토리 : myplus
디렉토리 : member
파일 : kims+_txt_mysql.php3
디렉토리 : diary
파일 : test.php