PHP disk_free_space() Function

❮ PHP Filesystem Reference

Example

Return the free space, in bytes, of the C: directory:

<?php
echo disk_free_space("C:");
?>

The output of the code above could be:

109693288448


Definition and Usage

The disk_free_space() function returns the free space, in bytes, of the specified filesystem or disk.

Tip: Look at the disk_total_space() to get the total size of a filesystem or disk.

Syntax

disk_free_space(directory)

Parameter Values

Parameter Description
directory Required. Specifies the filesystem or disk to check


Technical Details

Return Value: The number of free space (in bytes) on success, FALSE on failure
PHP Version: 4.1+

❮ PHP Filesystem Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.