<??php
	// ディレクトリのパスを記述
	$dir = “dragon_ball1”;
	// ディレクトリの存在を確認し、ハンドルを取得
	if(is_dir($dir) && $handle = opendir($dir)) {
		// ループ処理
		while(($file = readdir($handle)) !== false) {
//$path = $dir . $file;
			// ファイルのみ取得
			if(filetype($dir . “/” . $file) == “file”) {
				/********************
各ファイルへの処理
				  $file ファイル名
				  $path ファイルのパス
********************/
				// ファイル名を出力する
				echo $file . “
“;
			}
		}
} else {
echo “ディレクトリがない”;
	}
?>
参考サイト(このサイトのをほぼそのままコピーした)
http://webkaru.net/php/function-filetype/
  
  
  
  