Reading a Directory Listing Using opendir() : opendir « File Directory « PHP
- PHP
- File Directory
- opendir
Reading a Directory Listing Using opendir()
<?php
$dr = @opendir('/tmp/');
if(!$dr) {
echo "Error opening the /tmp/ directory!<BR>";
exit;
}
while(($files[] = readdir($dr)) !== false);
print_r($files);
?>
Related examples in the same category