note 70037 modified in function.delete by danbrown
| From: | danbrown@php.net | Date: | Wed, 26 Nov 2008 16:42:00 +0000 |
| Subject: | note 70037 modified in function.delete by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-146991@lists.php.net to get a copy of this message | ||
<?php
$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
fclose($fh);
?>
Now to delete testFile.txt we simply run a PHP script that is located in the same directory. Unlink
just needs to know the name of the file to start working its destructive magic.
<?php
$myFile = "testFile.txt";
unlink($myFile);
?>
The testFile.txt should now be removed.
--was--
$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
fclose($fh);
Now to delete testFile.txt we simply run a PHP script that is located in the same directory. Unlink
just needs to know the name of the file to start working its destructive magic.
$myFile = "testFile.txt";
unlink($myFile);
The testFile.txt should now be removed.
http://php.net/manual/en/function.delete.php