disk_total_space() function in PHP

PHPProgrammingServer Side Programming

The disk_total_space() function returns the total size of a directory. It returns the total number of bytes of a directory.

Syntax

disk_total_space(dir_name)

Parameters

  • dir_name − Specify the name of the directory.

Return

The disk_total_space() function returns the total available space in bytes.

Example

 Live Demo

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

Output

944459485184

Let us see another example.

Example

 Live Demo

<?php
   $total_space = disk_total_space("/home/");
   echo "Total Available Space: $total_space";
?>

Output

Total Available Space: 944459485184
raja
Published on 03-Oct-2018 12:15:38
Advertisements