Calculate Disk Space Usage Script

Calculate disk space usage script is used to will calculate total disk space or total disk partition space or total directory space.

Demo :



Type Directory Name :  
       

Example :

In the above demo just you enter directory name at text box and then click check button now will be displayed disk usage space for example type at text box /tmp directory name and click check button now will be displayed usage space. If you use this script window operating system type c: or d: at text box and check button click , now will be displayed usage space.

Code :

Following code is use to Calculate disk space usage script if you need code to copy and use to your website.


<?php
  $dir ="c:";
  $free = round(disk_free_space($dir)/1048576);
  $total = round(disk_total_space($dir)/1048576);
  $used = $total - $free;
  echo "$used MB used";
?>

In the above example $dir variables is used to assign drive name (directory name) and $free variable is used to calculate and assign to disk free space and $total variable is used to calculate and assign total disk space and finally from $total variables minus to $free this functionality assign to $used variables.

Free Download Script :

If you need to Calculate Disk Space Usage Script click and download from following link.

Download




Content