Checking file extensions
| From: | Ben Wiechman | Date: | Fri, 05 Jan 2001 15:17:11 +0000 |
| Subject: | Checking file extensions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32888@lists.php.net to get a copy of this message | ||
Alright, what I'm trying to do is index my site and build a list of files,
but I only want files with certain extensions to be indexed and I'm having
some wierd results.
When I use (where $entry is a file name)
if( ereg( "\.html$", $entry ) )
Everything works great, and only files with the html extension are included
in my list. But as soon as I add more file types, for example
if( ereg( "[\.html|\.htm]$", $entry ) )
as my condition allows files with types .htm, .html, .js, .shtml, .shtm, and
more through to be put in the list.
Can anyone see something wrong with my re?
Thanks for the help.
Ben