1
I tried to fetch the available space on the disk but it gets a lush number (124GB transformed) while it only has 12GB free. Here’s what I used.
<?php
$bytes = disk_free_space(".");
$si_prefix = array( 'B', 'KB', 'MB', 'GB', 'TB', 'EB', 'ZB', 'YB' );
$base = 1024;
$class = min((int)log($bytes , $base) , count($si_prefix) - 1);
echo $bytes . '<br />';
echo sprintf('%1.2f' , $bytes / pow($base,$class)) . ' ' . $si_prefix[$class] . '<br />';
?>
I’ll try that, I’ll inform you soon
– I_like_trains
Keep saying 124GB
– I_like_trains
Echo the disk_free_space function and tell us how many bytes it returns
– Piupz