- opendir: documentation ( source)
- closedir: documentation ( source)
- readdir: documentation ( source)
- is_dir: documentation ( source)
<?php
$dir = "/root/";
// Open a directory, and read its contents
if (is_dir($dir)){
if ($dh = opendir($dir)){
while (($file = readdir($dh)) !== false){
echo "filename:" . $file . "<br>";
}
closedir($dh);
}
}
?>