Tools, FAQ, Tutorials:
Removing a File in PHP
How To Remove a File in PHP?
✍: FYIcenter.com
If you want to remove an existing file, you can use the unlink() function. Here is a PHP script example on how to use unlink():
<?php if (file_exists("/temp/todo.txt")) { unlink("/temp/todo.txt"); print("File removed.\n"); } else { print("File does not exist.\n"); } ?>
This script will print:
File removed.
If you run this script again, it will print:
File does not exist.
⇐ Removing an Empty Directory in PHP
2016-11-20, 1476🔥, 0💬
Popular Posts:
How to Instantiate Chaincode on BYFN Channel? You can follow this tutorial to Instantiate Chaincode ...
How to Install Docker Desktop on Windows 10? You can follow this tutorial to Install Docker Desktop ...
How to add an API to an API product for internal testing on the Publisher Portal of an Azure API Man...
How to create the Hello-3.0.epub package? I have all required files to create Hello-3.0.epub. To cre...
How to read Atom validation errors at w3.org? If your Atom feed has errors, the Atom validator at w3...