The disk_free_space() function returns the free space, in bytes, of the specified directory.
PHP disk_free_space() Function has the following syntax.
disk_free_space(directory)
Parameter | Is Required | Description |
---|---|---|
directory | Required. | Directory to check |
PHP disk_free_space() Function returns the free space, in bytes, of the specified directory.
returns the free space for C: drive, in bytes.
<?php
echo disk_free_space("C:");
?>
The code above generates the following result.