PHP disk_free_space() Function
In this chapter you will learn:
- Definition for PHP disk_free_space() Function
- Syntax for PHP disk_free_space() Function
- Parameter for PHP disk_free_space() Function
- Return for PHP disk_free_space() Function
- Example - Get the free space for C: drive, in bytes
Definition
The disk_free_space() function returns the free space, in bytes, of the specified directory.
Syntax
PHP disk_free_space() Function has the following syntax.
disk_free_space(directory)
Parameter
Parameter | Is Required | Description |
---|---|---|
directory | Required. | Directory to check |
Return
PHP disk_free_space() Function returns the free space, in bytes, of the specified directory.
Example
returns the free space for C: drive, in bytes.
<?php
echo disk_free_space("C:");
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP disk_total_space() Function
- Syntax for PHP disk_total_space() Function
- Parameter for PHP disk_total_space() Function
- Return for PHP disk_total_space() Function
- Example - Get the total space, in bytes, for C: drive
Home » PHP Tutorial » PHP File Functions