What are the functions disk_total_space and disk_free_space used for in PHP?

The functions disk_total_space and disk_free_space in PHP are used to retrieve the total disk space and free disk space of a specified directory or disk partition on the server. These functions can be helpful in monitoring disk usage and managing file storage on the server.

$directory = '/path/to/directory';

$total_space = disk_total_space($directory);
$free_space = disk_free_space($directory);

echo "Total disk space: " . $total_space . " bytes<br>";
echo "Free disk space: " . $free_space . " bytes";