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, ∼2500🔥, 0💬
Popular Posts:
How to use "xsl-transform" Azure API Policy Statement? The "xsl-transform" Policy Statement allows y...
How to decode the id_token value received from Google OpenID Connect authentication response? Accord...
What are the differences of Differences of evaluateTransaction() and submitTransaction() of the fabr...
How to use the "forward-request" Policy Statement to call the backend service for an Azure API servi...
How to use the "return-response" Policy statement to build the response from scratch for an Azure AP...