note 39871 added to function.is-file
| From: | annettetruong at yahoo dot com | Date: | Fri, 13 Feb 2004 16:58:08 +0000 |
| Subject: | note 39871 added to function.is-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65103@lists.php.net to get a copy of this message | ||
The preceding works well except I get an error when I try to access $ext[1] when it doesn't
exist (i.e. for each directory).
I changed it to simply check for the existence of an extension and it works fine.
Annette.
$ext=explode('.', $file);
if($file != '.' && $file != '..' && array_key_exists(1, $ext))
{
echo "$file<br>\n";
}
----
Manual Page -- http://www.php.net/manual/en/function.is-file.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39871
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39871&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39871&report=yes
Search -- http://master.php.net/manage/user-notes.php