How to delete file in PHP? The unlink() function is used to delete a file in PHP.bool unlink (string $filename)