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, ∼2135🔥, 0💬
Popular Posts:
What is EPUB 2.0 Metadata "dc:publisher" and "dc:rights" elements? EPUB 2.0 Metadata "dc:publisher" ...
How to use the JSON to XML Conversion Tool at utilities-online.info? If you want to try the JSON to ...
How to detect errors occurred in the json_decode() call? You can use the following two functions to ...
What are the differences of Differences of evaluateTransaction() and submitTransaction() of the fabr...
How to troubleshoot the Orderer peer? The Docker container terminated by itself. You can follow this...