I need to convert random numbers into KB, MB, GB and TB. For example, if 2048 is generated, it needs to display as 2KB.
I am not sure where to start with this, except for generating a random number:
$number = rand(1,1000000);
echo $number;
Would really appreciate if someone pointed me to the right direction.