Re: [PHP] Delete File With Any File Extension

2010-06-15 Thread Ashley Sheridan
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
> 
> Regards
> Cherankrish
> 
> On Tue, Jun 15, 2010 at 4:17 PM, Shaun Thornburgh <
> shaunthornbu...@hotmail.com> 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/19780/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




Re: [PHP] Delete File With Any File Extension

2010-06-15 Thread cheran krishnamoorthy
You can't use regular expression with unlink directly.
have a look on this
http://www.phpfreaks.com/forums/index.php?topic=256367.0

Regards
Cherankrish

On Tue, Jun 15, 2010 at 4:17 PM, Shaun Thornburgh <
shaunthornbu...@hotmail.com> 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/19780/direct/01/
> We want to hear all your funny, exciting and crazy Hotmail stories. Tell us
> now
>


Re: [PHP] Delete File With Any File Extension

2010-06-15 Thread Adrian
Use glob() to get a list of matching afiles nd then unlink() them
separately.


> 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?


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



[PHP] Delete File With Any File Extension

2010-06-15 Thread Shaun Thornburgh

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/19780/direct/01/
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now