Get free disk space in PHP
The disk_free_space() function in PHP is an inbuilt function which is used to return the amount of free space in a specified directory. The disk_free_space() function denotes the free space in bytes.
It returns the available space on a filesystem or on a disk partition.
<?php
// specifying directory to check for free space
echo disk_free_space("D:");
?>
Output
10969328844
Example 2
<?php
// specifying directory to check for free space
echo disk_free_space("C:");
?>
Output
10969327231