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.
Â
⇒Working with Directoris and Files in PHP
⇒⇒PHP Tutorials
2016-11-20, 1115👍, 0💬
Popular Posts:
How to view API details on the Publisher Portal of an Azure API Management Service 2017 version? You...
Where to get a JSON.stringify() Example Code in JavaScript? Here is a good JSON.stringify() example ...
How to read RSS validation errors at w3.org? If your RSS feed has errors, the RSS validator at w3.or...
Where to find tutorials on the 2017 version of API Management Services at Azure Portal? Here is a li...
How to add request query string Parameters to my Azure API operation 2017 version to make it more us...