How can i delete unused and unneeded images from a folder using php ?
Expand Post »
Hi all
i need to know if there is by a way by any chance to delete unused images from my virtual directory or wwwroot folder dunamically on the user request using php ?
thank you all
Re: How can i delete unused and unneeded images from a folder using php ?
Yes this should be possible. There may be some scripts already written to do this although I am not aware of them. You could try searches on google and yahoo to see what you can find. If you don't find anything useful, you will find most of the php functions you will need here.
Re: How can i delete unused and unneeded images from a folder using php ?
it would be better to check 1st if the file is in the directory ^^
i got this from the php manual
hope it helps you as well
<?php
if(file_exists($file))
unlink($file);
?>
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.