Pastetool #436

URL: , Paste another

<?php
	function to_readble_size($size){
	switch (true)
	{
	case ($size > 1000000000000):
	$size /= 1000000000000;
	$suffix = 'TB';
	break;
	case ($size > 1000000000):
	$size /= 1000000000;
	$suffix = 'GB';
	break;
	case ($size > 1000000):
	$size /= 1000000;
	$suffix = 'MB'; 
	break;
	case ($size > 1000):
	$size /= 1000;
	$suffix = 'KB';
	break;
	default:
	$suffix = 'B';
	}
	return round($size, 2).$suffix;
	}
?>

Download code

This php code was pasted on February 26, 2010




Protected with advance Anti-SPAM techniques :)
Coded and designed by Fedmich
Follow us on Twitter