Created
April 9, 2012 13:59
-
-
Save og-shawn-crigger/2343619 to your computer and use it in GitHub Desktop.
Get Max Upload Size from PHP ini's 'post_max_size' && 'upload_max_filesize'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Simple Function to Get Max Upload Size from PHP | |
$max_upload = min(ini_get('post_max_size'), ini_get('upload_max_filesize')); | |
$max_upload = str_replace('M', '', $max_upload); | |
$max_upload = $max_upload * 1024; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That’s true, although a bit more rare.
If you need to account for those as well, you could use something like this to convert the value: