Computer >> Computer tutorials >  >> Programming >> PHP

disk_free_space() function in PHP


The disk_free_space() function returns directory’s free space in bytes.

Syntax

disk_free_space(dir_name);

Parameters

  • dir_name − Specify the name of the directory.

Return

The disk_free_space() function returns bytes of available space in a file. It returns false on failure.

Example

<?php
   echo disk_free_space("/home/");
?>

Output

832806768640