English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP disk_free_space() Function Usage and Example

PHP Filesystem Reference Manual

The disk_free_space() function can return the available space (in bytes) for the specified directory.

Syntax

float disk_free_space ( string $directory )

Given a string containing a directory, the disk_free_space() function can return the number of available bytes on the corresponding filesystem or disk partition.

Online Example

<?php
   echo disk_free_space("C:\");
   echo "\n";
   echo disk_free_space("E:\");
?gt;

Output Result

224150941696
209571344384

PHP Filesystem Reference Manual