How To Remove Or Delete A File With Php Code From A Directory?
- Forums
- PHP
- How To Remove Or Delete A File With Php Code From A Directory?
This Page Contains information about How To Remove Or Delete A File With Php Code From A Directory? By wallpaperama in category PHP with 0 Replies. [1270], Last Updated: Sat May 18, 2024
wallpaperama
Sun Apr 12, 2009
0 Comments
300 Visits
unlink()
today i was writing a php script which i needed to remove a file. deleting a file is easy with php, all you have to use is the unlink() function in php. once you execute the unlink() function in php, the file inside the () will be deleted.
for example, lets say i want to remove a file called: bad.jpg in my images/ directory so this is how i would go about removing an unwanted files:
<?php
unlink(/var/www/html/images/bad.jpg);
?>
thats it, easy huh?