| Home | About | Downloads | Features | Demo | FAQ | Forum | Screenshots | PHP Tutorials | |
<< PHP Rename a File |
PHP Tutorials |
PHP Upload a File >>
PHP Delete a File - unlink()
The unlink() function is what you need to use to delete a file. It only requires one parameter, the file name to delete. Here is an example:
<?php
unlink('example.txt'); ?> Now you have to be careful when trying to delete a file. Something could go wrong (such as a typing error) and you could end up deleting the wrong file! There is no way to get it back either :S << PHP Rename a File | PHP Tutorials | PHP Upload a File >> |
|
| © Douglas Rennehan 2007 - 2008 | Terms of Service | Privacy Policy | Valid XHTML 1.0 | Valid CSS | |