unlink ($filename, $context);The following programs illustrate the above approach:Program 1:This program uses the unlink() function to remove a file from a directory.
Suppose there is a file named
"$file_pointer has been deleted"
);
}
?>
Output:Warning: unlink() expects parameter 1 to be a valid path, resource given in C: xampphtdocsserver.php on line 12 Resource id # 3 cannot be deleted due to an errorNote:If the file does not exist, an error message will appear.