PHP FILES
Moderator: General Moderators
-
truepal20032001
- Forum Commoner
- Posts: 27
- Joined: Mon Jun 25, 2007 8:28 pm
PHP FILES
How would i say in php to delete all the files with the same filetype, like... delete all JPGs from this folder... but only the jpgs...
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: PHP FILES
If you are using php5, then you can use scandir to scan the directory, then check the extension, if the extension matches what you want, then unlink the file.
Re: PHP FILES
I would prefer using glob() in this case.
There are 10 types of people in this world, those who understand binary and those who don't
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: PHP FILES
Cheers VladSun. I did not know about that, I have just looked it up, very useful 
-
truepal20032001
- Forum Commoner
- Posts: 27
- Joined: Mon Jun 25, 2007 8:28 pm
Re: PHP FILES
Thankyou very much!