Search
Syndication
Sponsors

File list of a folder

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)


<?php
//folder to check
$folder = “C:/xampp/htdocs/xampp/wordpress/wp-includes”;
$handle = opendir($folder);
//loop through the directory
while ($file = readdir($handle))
{    
$files[] = $file;
}
closedir($handle); 
//display every file in folder
foreach ($files as $file)
{    
echo “<a href=$folder$file>$file</a>”.”<br />”;
}
?>

Related posts:

  1. Delete files that are over 7 days old <?php $dir = ‘/path/to/dir’; if ($handle = opendir($dir)) {  ...
  2. Manual Installation Tutorial for PHP 5 on IIS 5.1 (Windows XP Pro) Before we begin any installation steps, the first thing we...
  3. create a gzip file this example backs up the index.php as a gzip file...
  4. FTP file upload example upload a single file to a FTP server // FTP...

Related posts brought to you by Yet Another Related Posts Plugin.



Tags: ,

Leave a Reply