close

例子

<?php
echo diskfreespace("C:");
?>
輸出:
209693288558

 

<?php
$f = diskfreespace("/raid/vhost/www/");
echo HumanSize($f);

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");
}
?>

 

輸出:

1.11630124599 terabytes

arrow
arrow
    全站熱搜

    stockwfj3 發表在 痞客邦 留言(0) 人氣()