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

Updated on: 24-Jun-2020

94 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements