File System Reference In PHP
Posted by admin | Posted in PHP, scripts | Posted on 29-06-2009
0
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”);
}
?>
Related posts:












