disk_total_space() function in PHP


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

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 24-Jun-2020

80 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements