The unlink() function deletes a file.
This function returns TRUE on success, or FALSE on failure.
Syntax
| unlink(filename,context) |
| Parameter | Description |
|---|---|
| filename | Required. Specifies the file to delete |
Example
<?php
$file = “newfile.txt”;
if (!unlink($file))
{
echo (“Error deleting $file”);
}
else
{
echo (“Deleted $file”);
}
?>
Definition and Usage
The rmdir() function removes an empty directory.
This function returns TRUE on success, or FALSE on failure.
Syntax
| rmdir(dir,context) |
| Parameter | Description |
|---|---|
| dir | Required. Specifies the directory to be removed |
Example
<?php
$path = “include”;
if(!rmdir($path))
{
echo (“Could not remove $path”);
}
?>
Incoming search terms:
- internally which tool does the dns_get_record uses (1)
- inurl:image php?id=12 (1)
- php includes system tips (1)
- PHP system reference (1)
You will also be interested in ,
- To Remove An Empty Element From An Array Using PHP
- Get browser language using php
- PHP Most Potentially Dangerous Feature, Secure It Today PHP Secrets
- Pass PHP Value To Javascript
- Using no-cache for Stop Caching in Firefox and Internet Explorer
- Tag cloud using php, mysql and ajax with filter
- Secure PHP Scripts
- Simple PHP Login Script
- Url rewriting examples using .htaccess
- Post Data To Another Website Using cURL In PHP


this is a very helpful tutorial.
Thanks both of you
Kelly Blue
Web Developer, Australia