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

 Live Demo

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

Output

832806768640
karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know


Advertisements