Disk total space : Disk Drive « File Directory « PHP






Disk total space

<?php
   $systempartitions = array("/", "/home","/usr", "/www");
   foreach ($systempartitions as $partition) {
      $totalSpace = disk_total_space($partition) / 1048576;
      $usedSpace = $totalSpace - disk_free_space($partition) / 1048576;
      echo "Partition: $partition (Allocated: $totalSpace MB. Used: $usedSpace MB.) <BR>";
   }
?>


           
       








Related examples in the same category

1.Get disk free space for Unix/Linux
2.Get free disk space for C: drive