Home » , » Manage Server Hard Disk Using PHP

Manage Server Hard Disk Using PHP

Written By Unknown on Senin, 11 Oktober 2010 | 22.59

PHP provides some sweet functions to manage the server's hard disk. Here's how to use them.

copy()

Copies a file from a source file.
$result = copy('original.txt','new.txt');

disk_free_space()

Returns the number of bytes remaining on the disk.
$free_space = disk_free_space('/');

disk_total_space()

Returns the size of the disk in bytes.
$total_space = disk_total_space('/');

file_exists()

Confirms whether or not a file exists.
$exists = file_exists('rubbish.php');

unlink()

Deletes a file from the disk.
$file = 'rub.txt';
if(file_exists($file)) 
  unlink($file);
}

Share this article :

Posting Komentar

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kumpulan Kata Broadcast Blackberry - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger