I have a domain name like 'mydomain.com'. I want to check how much space available on server with this domain name with the help of php.
Like for our hard drive we use disk_total_space("C:");
. Can anyone help me to get the solution.
Depending on the structure of the file system you can use something like the following for Linux hosts:
$df = round(disk_free_space("/var/www") / 1024 / 1024 / 1024);
print("Free space: $df GB");
Or in your case it sounds like you're running on Windows so:
$df = round(disk_free_space("C:") / 1024 / 1024 / 1024);
print("Free space: $df GB");
The main function is used to get space available is same as above said.
you have to use disk_free_space()
. but the different is to know the server path. And put it in braces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With