i've using this link for getting remote file size but i am getting sizes in bites i want to show that in Kb,Mb or in Gb
Asked
Active
Viewed 457 times
-3
-
Please add your code so that others could help you out. – linuxartisan Aug 20 '16 at 06:03
2 Answers
0
You can convert your bytes value into kb/mb/gb
1 byte = 0.001 KB
1 kb = 0.001 MB
likewise.

jarvo69
- 7,908
- 2
- 18
- 28
-
In some situations, you might want to divide bytes by 1024 instead of 1000 to get kilobytes, and again by 1024 to get megabytes. – roderick young Aug 20 '16 at 06:08
-1
Well the easiest way is just get the result and divide it by 1024 for K, 1024 again for Meg, and 1024 again for Gig?
So
$bytes = curl_get_file_size( $url );
Then
$kbytes = $bytes / 1024;
$mbytes = $kbytes / 1024;
$gbytes = $mbytes / 1024;

Forbs
- 1,256
- 1
- 7
- 9