<?php
// this function was be got from phpmyadmin
function PMA_get_real_size($size = 0)
{
if (! $size) {
return 0;
}
$scan['gb'] = 1073741824; //1024 * 1024 * 1024;
$scan['g'] = 1073741824; //1024 * 1024 * 1024;
$scan['mb'] = 1048576;
$scan['m'] = 1048576;
$scan['kb'] = 1024;
$scan['k'] = 1024;
$scan['b'] = 1;
foreach ($scan as $unit => $factor) {
if (strlen($size) > strlen($unit)
&& strtolower(substr($size, strlen($size) - strlen($unit))) == $unit) {
return substr($size, 0, strlen($size) - strlen($unit)) * $factor;
}
}
return $size;
} // end function PMA_get_real_size()
$upload_max_filesize = PMA_get_real_size(ini_get('upload_max_filesize'));
$post_max_size = PMA_get_real_size(ini_get('post_max_size'));
$min_upload_size = $upload_max_filesize > $post_max_size ? $post_max_size : $upload_max_filesize;
echo number_format($min_upload_size/1024).' KiB';
?>