disk_free_space in PHP

Syntax of disk_free_space

float disk_free_space(string path)

Returns the number of bytes of free space available on the disk partition or filesystem at path

Example of disk_free_space

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

// On Windows:
$df_c = disk_free_space("C:");
$df_d = disk_free_space("D:");
?>

Leave a Comment