note 16090 modified in function.stristr by victor
| From: | victor@php.net | Date: | Wed, 02 Oct 2002 10:34:30 +0000 |
| Subject: | note 16090 modified in function.stristr by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-37529@lists.php.net to get a copy of this message | ||
[Editor's note: blaster at jazz4ever dot tk tells us that it's bad to use this check for
the extension since double extensions can be used (eg file.jpg.vbs which could be a virus)]
i used this function to scan a directory searching for images:
$eleimg=opendir("../$dir");
while ($file=readdir($eleimg)) {
if (stristr($file,".jpg") || stristr($file,".gif")) {
echo "<option value='$file'>$file\n";
}
}
--was--
i used this function to scan a directory searching for images:
$eleimg=opendir("../$dir");
while ($file=readdir($eleimg)) {
if (stristr($file,".jpg") || stristr($file,".gif")) {
echo "<option value='$file'>$file\n";
}
}
http://www.php.net/manual/en/function.stristr.php