diskfreespace() function in PHP

PHPProgrammingServer Side Programming

The diskfreespace() function returns the available free space in a directory and is an alias of disk_free_space().

Syntax

diskfreespace(dir_name)

Parameters

  • dir_name − Directory to be specified.

Return

The diskfreespace() function returns the free space in bytes.

Example

 Live Demo

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

Output

832931168256

Let us see another example.

Example

 Live Demo

<?php
   $free_space = diskfreespace("/home/");
   echo "Free Space: $free_space";
?>

Output

Free Space: 832931168256
raja
Published on 03-Oct-2018 08:48:17
Advertisements