note 20046 added to function.filetype
| From: | no dot timm at spam dot juvik dot please dot org | Date: | Wed, 20 Mar 2002 15:43:35 +0000 |
| Subject: | note 20046 added to function.filetype | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27993@lists.php.net to get a copy of this message | ||
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
}
--
http://www.php.net/manual/en/function.filetype.php
http://master.php.net/manage/user-notes.php?action=edit+20046
http://master.php.net/manage/user-notes.php?action=delete+20046
http://master.php.net/manage/user-notes.php?action=reject+20046