Hello,
How do I echo all the files in a directory? I am a beginner at all this, so forgive me.
Thanks.
Hello,
How do I echo all the files in a directory? I am a beginner at all this, so forgive me.
Thanks.
http://www.php.net/manual/en/function.opendir.php
Look at the usage example.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
PHP Code:$files = glob('*.*');
$files = array_filter($files, 'is_file');
if(count($files))
{
echo '<ul>';
}
foreach($files as $file)
{
echo '<li>' . basename($file) . '</li>';
}
if(count($files))
{
echo '</ul>';
}
Bookmarks