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?