How to Delete a file in PHP
How to Delete a file in PHP: PHP Delete File
Syntax: unlink(FILE_PATH);
Example: unlink(‘log.txt’);
Note:
This function will return TRUE on success or FALSE on failure.
In order for this to be successful, the following condition must be true.
- The file must be closed
- The web app must have write permission on the folder that contains the file.
You may also like - Core PHP Interview Questions#Example
You may also like - Node js Interview Questions