How to use PHP & Opendir() Open Directory Learn how to use the PHP to List Directory and using Opendir()
ShotDev Focus:
- PHP & List/Open Directory by Opendir()
Example
php_opendir.php
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<?php
$objOpen = opendir("shotdev");
while (($file = readdir($objOpen)) !== false)
{
echo "filename: " . $file . "<br />";
}
?>
</body>
</html>
Create a php file and save to path root-path/myphp/
Run
http://localhost/myphp/php_opendir.php
Screenshot


