Recent Posts

This Post Has Been Viewed 152 Times.

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”);
}
?>

VN:F [1.5.7_846]
Rating: 0.0/10 (0 votes cast)
VN:F [1.5.7_846]
Rating: 0 (from 0 votes)
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • De.lirio.us
  • Xerpi

Related posts:

  1. working with directories using php
  2. Find Absolute Path Of A File Or Directory Using PHP
  3. Simple file upload script using php
  4. Finding size of a directory using php
  5. Reading file using php

Write a comment

Spam Protected