note 18385 rejected from function.readdir by sander
| From: | sander@php.net | Date: | Sat, 06 Apr 2002 19:16:34 +0000 |
| Subject: | note 18385 rejected from function.readdir by sander | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-28757@lists.php.net to get a copy of this message | ||
I use this small code, to diferentiate a file from a directory,
if its a directory then I link it again but
$basedir = $basedir . "/" . $file; (you get the point)
or if its a file then I link the file to my jukebox page.
<?
$BaseDir = "/home/acidfilez/public_html/mp3/";
$flz = $BaseDir . "/.";
$dir=opendir ("$flz");
while ($file = readdir($dir))
{
if ($file == "." || $file == "..") continue;
{
$tempo = "/" . $file;
if (is_dir ("$tempo")) //checks if a filo or a
{ //Directories
echo "$file is a directory <br>";
}
else
{//Files
//$file = substr("$file", -4);
//removes .mp3
echo"$file is a file <br>";
};
};
};
closedir($dir);
?>
email me if you need further help to:
Magno Cardona Heck
acidfilez@entelchile.net