Deleting a File in PHP


Use unlink() to delete a file.

Source Code

$filename = "delete_me.txt";
if (unlink($filename)) {
    echo "File deleted successfully.";
} else {
    echo "Could not delete the file.";
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments