Location: PHPKode > scripts > Size > size/size.class_example.php
<?php

//call class file
require_once 'size.class.php';

//path to get information
$path = "/path/to/get/size";

//object builder
$size = new size($path);

/*for windos drives use (depends of your drives configuration)
$path = "C:"; for hard disk 
$path = "D:"; for compact disk
*/

//total size in bytes
echo "<br>";
echo "Total Size: ";
echo $size->total_size($path);
echo " bytes"; 

//free space in bytes
echo "<br>";
echo "Free Space: ";
echo $size->free_space($path);
echo " bytes";

//used space in bytes
echo "<br>";
echo "Used Space: ";
echo $size->used_space($path);
echo " bytes";

//total size in MB
echo "<br>";
echo "Total Size: ";
echo ($size->total_size($path))/1048576;
echo " MB"; 

//free space in MB
echo "<br>";
echo "Free Space: ";
echo ($size->free_space($path))/1048576;
echo " MB";

//used space in MB
echo "<br>";
echo "Used Space: ";
echo ($size->used_space($path))/1048576;
echo " MB";

?>
Return current item: Size