PHP disk_total_space() Function

In the disk_total_space() function is used to gives how much total space available in specified disk(directory). Which function is returns two out puts that are TRUE and FALSE.

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 total space for example type at text box /tmp directory name and click check button now will be displayed total space. If you use this script windows operating system type c: or d: at text box and check button click , now will be displayed total space.

Code :

Following code is use to disk_total_space function if you need code to copy and use to your website.


<?php
  $dir ="c:";
  $total = round(disk_total_space($dir)/1048576);
  echo " $total MB Total Space";
?>

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

Free Download Script :

If you need to disk total space function code click and download from following link.

Download




Content