Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

disk_free_space()

Example

Retrieve the amount of free space, in bytes, available on the C: drive.

<?php
echo disk_free_space(“C:”);
?>

The result of the code above might be:

109693288448

Definition and Usage

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

 

Tip: Use disk_total_space() to find the total size of a filesystem or disk.

Syntax

disk_free_space(directory)

Parameter Values

 

Parameter

Description

directory

Mandatory. Specifies the filesystem or disk to be checked.

Technical Details

Return Value:

Returns the amount of free space in bytes on success, or FALSE on failure.

PHP Version:

4.1+