Tutorials Point


  Learning PHP
  Advanced PHP
  PHP Function Reference
  PHP Useful Resources
  Selected Reading

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

PHP Function disk_free_space()


previous

Advertisements

Syntax

float disk_free_space ( string $directory );

Definition and Usage

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

Paramters

ParameterDescription
directoryA directory of the filesystem or disk partition.

Return Value

Returns the number of available bytes as a float.

Example

Following is the usage of this function:

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

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

previous Printer Friendly

Advertisements


  

Advertisements