Situatie
To delete a file in PHP, use the unlink
function. Let’s go through an example to see how it works.
Solutie
<?php
If (unlink(
'C:\Users\flcri\Desktop\Solutii\3\test.txt'
)) {
// file was successfully deleted
}
else
{
// there was a problem deleting the file
}
?>
The first argument of the
unlink
function is a filename which you want to delete. The unlink
function returns either TRUE
or FALSE
, depending on whether the delete operation was successful.
Leave A Comment?