you could use a loop and do something like

1. read a directory getting all the files that have that name.
2. loop through and delete off each file that has any given extension or
selected extensions, or all with that file name ... example:

=================================
if ( $dir = opendir($path) )
{
    while ($file = readdir($dir))
    {
         if (  !eregi( "^thefilename", $file )  ) continue;  ##use regex to
check for files with the specified "$filename"; if file not w/ this name,
skip it

        if ( is_file( $file ) && $file != "." && $file != ".." && $file !=
"" )


         unlink( $file ); ## this will delete off the file
        }
    }
}
closedir($dir);
=================================

*You should look into regular expressions to help you parse out bits from a
string ( If you aren't already familiar with regex's ).

Good luck!
Nicole Amashta
www.aeontrek.com

======================
"Symeon Charalabides" <[EMAIL PROTECTED]> wrote in message
3C4B0279.16592.F5B4B70@localhost">news:3C4B0279.16592.F5B4B70@localhost...
> I must be missing something here...
> I've got these 3 lines of code:
>
> if (file_exists('dir/'.$filename.'.gif'))
> unlink('dir/'.$filename.'.gif');
> if (file_exists('dir/'.$filename.'.jpg'))
> unlink('dir/'.$filename.'.jpg');
> if (file_exists('dir/'.$filename.'.png'))
> unlink('dir/'.$filename.'.png');
>
> ...and I'm sure they can be turned into one using some kind of wildcard,
only I
> can't figure out how. In fact, I don't mind erasing files of a certain
filename
> with ANY extension at all. I just know, in this case, that it can only be
one of
> those three.
> Any advice, people?
> Symeon Charalabides (cosmopolitan trainee)
> ------------------------------------------
> http://www.webmate.gr
>



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to