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_total_space()

Example

Retrieve the total size, in bytes, of the C: drive.

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

The result of the code above might be:

119990349824

Definition and Usage

The disk_total_space() function returns the total size, in bytes, of the specified filesystem or disk.

 

Tip: Use disk_free_space() to find the available free space on a filesystem or disk.

Syntax

disk_total_space(directory)

Parameter Values

Parameter

Description

directory

Mandatory. Specifies the filesystem or disk to check.

Technical Details

Return Value:

Returns the total size in bytes on success, or FALSE on failure.

PHP Version:

4.1+