On Windows, this also works with distant files, by using their full network path.
For instance, this will give the % of free disk space on the share "dir" from remote host "server" :
<?php
$path = "\\\\server\\dir";
echo(floor(100 * disk_free_space($disk) / disk_total_space($disk)));
?>
It can also work with drive letters mapped to a network path in certain cases.