- opendir: documentation ( source)
- closedir: documentation ( source)
- readdir: documentation ( source)
<?php
if ($handle = opendir('/home/sjon/phpshell/root/php-5.5.0/lib/php/extensions')) {
echo "Directory handle: $handle\n";
echo "Entries:\n";
/* This is the correct way to loop over the directory. */
while (false !== ($entry = readdir($handle))) {
echo "$entry\n";
}
closedir($handle);
}