Re: Delete File With Any File Extension

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2010-06-15 at 16:23 +0530, cheran krishnamoorthy wrote:

> You can't use regular expression with unlink directly.
> have a look on this
> http://www.phpfreaks.com/forums/index.php?topic=256367.0
> 
> <http://www.phpfreaks.com/forums/index.php?topic=256367.0>Regards
> Cherankrish
> 
> On Tue, Jun 15, 2010 at 4:17 PM, Shaun Thornburgh <
> shaunthornburgh@xxxxxxxxxxx> wrote:
> 
> >
> > Hi,
> >
> > I need to delete a file with any file extension where i know the name of
> > the file, is it possible to use regular expressions with the unlink
> > function?
> >
> > Thanks
> >
> > _________________________________________________________________
> > http://clk.atdmt.com/UKM/go/197222280/direct/01/
> > We want to hear all your funny, exciting and crazy Hotmail stories. Tell us
> > now
> >


Make sure you don't accidentally delete files you need. Once you've got
the list of files with the glob() function as Adrian mentioned, don't
just loop through and delete them all, as you could end up removing a
file which you really need later.

Thanks,
Ash
http://www.ashleysheridan.co.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux