Categories:
.NET (357)
C (330)
C++ (184)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (2)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Remove a File
How To Remove a File? - PHP Script Tips - Working with Directoris and Files
✍: 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.
2007-04-23, 5334👍, 0💬
Popular Posts:
When should the method invokeLater() be used? This method is used to ensure that Swing components ar...
How do we host a WCF service in IIS? Note: - The best to know how to host a WCF in IIS is by doing a...
How To Enter Microseconds in SQL Statements? - MySQL FAQs - Introduction to SQL Date and Time Handli...
What is the difference between delegate and events? ã Actually events use delegates in bottom. But ...
When should the register modifier be used? Does it really help? The register modifier hints to the c...