[resolved] Deleting Files

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ibanez270dx
Forum Commoner
Posts: 74
Joined: Thu Jul 27, 2006 12:06 pm
Location: Everywhere, California

[resolved] Deleting Files

Post 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
Last edited by ibanez270dx on Mon Aug 14, 2006 10:37 am, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You need to specify specific files. glob() may be of interest.
ibanez270dx
Forum Commoner
Posts: 74
Joined: Thu Jul 27, 2006 12:06 pm
Location: Everywhere, California

Post by ibanez270dx »

It works! Thanks!

This is what I used:

Code: Select all

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