note 20046 deleted from function.filetype by vincent
| From: | vincent@php.net | Date: | Sat, 16 Aug 2003 13:06:07 +0000 |
| Subject: | note 20046 deleted from function.filetype by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54344@lists.php.net to get a copy of this message | ||
Note Submitter: no.timm@spam.juvik.please.org
----
The way I use to check if a $file is a directory or not, is to see if it has an extension. If a
directory name has a "." in it, this wouldn't work, but there are ways to go around
that I think. Anyway, this is it:
$ext = strrchr($file,'.'); // check for extension
if ($ext == "") { // if no extension is found
echo $file; // print filename
}