search for in the  
<dirnamedisk_total_space>
Last updated: Thu, 19 May 2005

disk_free_space

(PHP 4 >= 4.1.0, PHP 5)

disk_free_space -- Returns available space in directory

Description

float disk_free_space ( string directory )

Given a string containing a directory, this function will return the number of bytes available on the corresponding filesystem or disk partition.

Example 1. disk_free_space() example

<?php
// $df contains the number of bytes available on "/"
$df = disk_free_space("/");

// On Windows:
disk_free_space("C:");
disk_free_space("D:");
?>

Note: This function will not work on remote files as the file to be examined must be accessible via the servers filesystem.

See also disk_total_space()



User Contributed Notes
disk_free_space
Ashraf M Kaabi
01-Mar-2005 10:38
and also you can know the used space , in this
example :
<?
function disk_used_space($drive)
         {
         return
disk_total_space("$drive:") - disk_free_space("$drive:");
         }

echo
disk_used_space(C);
?>
Ashraf M Kaabi
01-Mar-2005 11:55
and also you can get Human Disk Free Space result in GB in This Example :
<?
function dfs_gb($drive)
{
       if(
$drive)
       {
       return
round(diskfreespace("$drive:")/1024/1024/1024,2); //To Get Human Result in GB we divid it By 1024 Byte & 1024 KiloByte & 1024 MegaByte
      
}
}

echo
dfs_gb(D); //(D) is a drive letter
?>
aidan at php dot net
15-Oct-2004 07:49
To make human readable file sizes, see this function:

http://aidan.dotgeek.org/lib/?file=function.size_readable.php

<dirnamedisk_total_space>
 Last updated: Thu, 19 May 2005
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: The Server Pages
Last updated: Thu May 19 17:35:34 2005 CDT