When using
ini_get(\"upload_max_filesize\");
it actually gives you the string specified in the php.ini file.
It is not good to use
Looks like it isn't possible.
Because of this, I am going to continue using this code:
function convertBytes( $value ) {
if ( is_numeric( $value ) ) {
return $value;
} else {
$value_length = strlen($value);
$qty = substr( $value, 0, $value_length - 1 );
$unit = strtolower( substr( $value, $value_length - 1 ) );
switch ( $unit ) {
case 'k':
$qty *= 1024;
break;
case 'm':
$qty *= 1048576;
break;
case 'g':
$qty *= 1073741824;
break;
}
return $qty;
}
}
$maxFileSize = convertBytes(ini_get('upload_max_filesize'));
Originally from this helpful php.net comment.
STILL OPEN TO ACCEPT BETTER ANSWERS