Mega Code Archive
File size function
= 1073741824)
{
$size = round($size / 1073741824) . " gigabytes ";
}
elseif($size >= 1048756)
{
$size = round($size / 1048576) . " megabytes ";
}
elseif($size >= 1024)
{
$size = round($size / 1024) . " kilobytes ";
}
else
{
$size = $size . " bytes ";
}
return $size;
}
?>
Now lets test this function out with the following .
";
echo "this page is " . file_size("filesize.php");
?>