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)
- php includes system tips (1)
- PHP system reference (1)
You will also be interested in ,
- Url rewriting examples using .htaccess
- Detect the user Operating System flavour using php
- "Header already sent" in php error and other use of Header function in PHP
- Redirect webpage using php
- Simple file upload script using php
- PHP is not executed and source visible
- Speed up wordpress using .htaccess part 1
- Appending string using php to a text file
- Sort MYSQL data according to the date in php or mysql itself
- Check whether url or domain exists using php

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