Return to Snippet

Revision: 16882
at August 18, 2009 06:21 by dsntos


Initial Code
function list_files($dir)
{
	if(is_dir($dir))
  	{
  		if($handle = opendir($dir))
  		{
  			while(($file = readdir($handle)) !== false)
  			{
  				if($file != "." && $file != ".." && $file != "Thumbs.db")
  				{
  					echo '<a target="_blank" href="'.$dir.$file.'">'.$file.'</a><br>'."\n";
  				}
  			}
  			closedir($handle);
  		}
	}
}

Initial URL
http://webdeveloperplus.com/php/21-really-useful-handy-php-code-snippets/

Initial Description

                                

Initial Title
List Directory Contents

Initial Tags
php, directory

Initial Language
PHP