You are here: Getting the filenames from a folder « PHP Programming Language « IT news, forums, messages
Getting the filenames from a folder

Posted by Krustov on 10/30/05 17:10

<?php
$dirname = ".";
$dh = opendir($dirname);
while ($file = readdir($dh))
{
if (is_dir ("$dirname/$file"))
{
print "";
}
print "$file<br>";
}
closedir ($dh);
?>


..
...
aaa.html
etc

The above code brings up the single and twin full stops - presumably the
option to change directorys or whatever if wanted .

Got the code snippet via google and just wondered if the above code is
the best way it could be written .

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация