Monday 27 July 2009

BYTES TO OTHER FORMATS

function HumanSize($Bytes)
{
$Type=array("", "kilo", "mega", "giga", "tera", "peta", "exa", "zetta", "yotta");
$Index=0;
while($Bytes>=1024)
{
$Bytes/=1024;
$Index++;
}
return("".$Bytes." ".$Type[$Index]."bytes");
}

echo HumanSize(33535356576765656766656445456);
?>

No comments:

Post a Comment