How to delete file in PHP
Posted by Raj
How to delete file in PHP:
In this article,I will explain how to delete file using php unlink function with sample example.
unlink: Deletes a file
Example:
you can use this script to delete file.
<?php
$filename = "testfile.txt";
unlink($filename);
?>
Example:
<?php
$file = fopen('test.txt', 'a');
fwrite($file, 'how to delete file');
fclose($file);
unlink('test.txt');//delete test.txt file.
?>
In this article,I will explain how to delete file using php unlink function with sample example.
unlink: Deletes a file
Example:
you can use this script to delete file.
<?php
$filename = "testfile.txt";
unlink($filename);
?>
Example:
<?php
$file = fopen('test.txt', 'a');
fwrite($file, 'how to delete file');
fclose($file);
unlink('test.txt');//delete test.txt file.
?>
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
delete file php,
how to delete file in php,
how to remove files.delete file in php,
PHP,
php delete a file,
php delete file,
PHP interview questions and answers,
remove file
.You can leave a response, or trackback from your own site.