Page 1 of 1

[resolved] Deleting Files

Posted: Mon Aug 14, 2006 10:28 am
by ibanez270dx
Hi,
I'm trying to do an unlink command like so: unlink(*.xls) . It doesn't work and I have tried it with single and double quotes. Can anyone help me?

Thanks!
- Jeff

Posted: Mon Aug 14, 2006 10:30 am
by feyd
You need to specify specific files. glob() may be of interest.

Posted: Mon Aug 14, 2006 10:37 am
by ibanez270dx
It works! Thanks!

This is what I used:

Code: Select all

foreach (glob("*.xls") as $filename)
	{
   	 unlink($filename);
	}