diskfreespace() function in PHP



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
karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know


Advertisements