Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

php
html
css
disk
communitycreator

What is the PHP disk_total_space() function?

Behzad Ahmad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The disk_total_space() function in PHPHypertext Preprocessor is used to return the total number of bytes that are in the specified disk or filesystem.

Syntax


disk_total_space(directory)

Parameters

  • directory: It is used to specify the name of the disk whose size we want to check.

Return value

It returns the total size in bytes of the specified directory. It returns false in case of failure.

Code

The basic PHP code to demonstrate the use of the disk_total_space() function is as follows:

<?php
  echo disk_total_space("D:");
?>

Explanation

The code above returns the total number of bytes in the D drive.

RELATED TAGS

php
html
css
disk
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring