PHP HELP PLEASE....
PHP HELP PLEASE....
- Started
- Last post
- 4 Responses
- effour
Below is the code. All I want is ".$filesize." to only display 3 digits or the actual KB's of the file, opposed to the actual bytes its currently displaying.
Thanks!
---------
echo " ".$filesize." kb ";
- Nematoth0
Just divide by 1024 and round to however many digits you want..
$size = round(($filesize/1024),3);
//change the 3 to the numer of digits you want after the decimal placeecho " ".$size." kb ";
Hope that helps...
- cosmo0
$size = $_FILES['file_field']['size']/10...
- Nematoth0
there's an extra space between the 2 and 4..
it should read 1024, rather than 102 4
- effour0
awesome...worked great!
thanks team!