Situatie
The disk_total_space() function in PHP is an inbuilt function which is used to return the total space of a specified directory. The disk_total_space() function denotes the total space in bytes. It returns the total space on a filesystem or on a disk partition.
The disk_total_space() function returns the total number of bytes on the corresponding filesystem or disk partition for a specified directory inputted as a string.
Solutie
Pasi de urmat
Syntax:
float disk_total_space ( string $directory )
Parameters: The disk_total_space() function in PHP accepts only one parameter $directory which is directory.
Return Value: It returns the total space on a filesystem or on a disk partition.
Errors And Exception:
- The disk_total_space() function in PHP may give improper results if a file name is given as parameter instead of a directory.
- The disk_total_space() function in PHP doesn’t works for remote files.It only works on files which are accessible by the server’s filesystem.
Program 1: Input : disk_total_space("D:"); Output : 10969328844798729 Input : disk_total_space("C:"); Output : 104379834795739795
<?php
// specifying directory to check for total space
echo disk_total_space(“D:”);
?>
Leave A Comment?