note 23763 added to function.eregi
| From: | henrik jensen | Date: | Sat, 27 Jul 2002 14:05:51 +0000 |
| Subject: | note 23763 added to function.eregi | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33642@lists.php.net to get a copy of this message | ||
Looking for at regex to check if a file is an image file, this seems to work?
Note: it does not check for illegeal filesystem names - it only looks at the filename extension.
if (eregi ("(.)+\\.(jp(e){0,1}g$|gif$|png$)",$filename)){
// This is an imagefile
}
[ remove this_ from emailaddress ]
--
http://www.php.net/manual/en/function.eregi.php
http://master.php.net/manage/user-notes.php?action=edit+23763
http://master.php.net/manage/user-notes.php?action=delete+23763
http://master.php.net/manage/user-notes.php?action=reject+23763