PHP: How to list files in a directory without listing subdirectories
It should be like this, I think:
$files = scandir($dir);
foreach($files as $file)
{
if(is_file($dir.$file)){
....
Just use is_file
.
Example:
foreach($files as $file)
{
if( is_file($file) )
{
// Something
}
}