PHP file Delete

The php unlink() function is used to delete or destroy files. This function returns TRUE on success, or FALSE on failure.

$myFile = “testfile.txt”;
$return = unlink($myFile);
if(!$return)
{
echo (“Error deleting on $myFile”);
}
else
{
echo (“Deleted $myFile”);
}

Posted in Php