(PHP 3, PHP 4 >= 4.0.0)
int opendir (string path)
int opendir
ディレクトリ・ハンドルをオープンします。この関数は、この後、 closedir(), readdir(), rewinddir() 関数コールで使用されます。
path が有効なディレクトリでないかまたは権 限が制限されているかファイルシステムのエラーによりディレクトリが オープンできない場合、opendir() は FALSE を返 し、PHPエラーを生成します。opendir()のこのエラー 出力は、関数名の前に `@' を付けることにより抑制できます。
例 1opendir() の例
<?php if ($dir = @opendir("/tmp")) { while($file = readdir($dir)) { echo "$file\n"; } closedir($dir); } ?>