PHP disk_total_space() function

Definition and Usage

The disk_total_space() function returns the total disk size of the specified directory.

Syntax

disk_total_space(directory)
Parameter Description
directory Required. Specifies the directory to be checked.

Description

directory The parameter is a string of a directory. The function returns all the bytes according to the corresponding file system or disk partition.

Hint and Comments

Hint:The function returns the total size of the disk partition at the directory, so the result obtained from different directories of the same disk partition is completely the same. It supports loading a disk partition as a subdirectory in Unix and Windows 200x/XP, so it is very meaningful to use this function correctly in this case.

Example

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

Output similar to this:

509693888668