PHP How to find the maximum allowed POST data?

Is there a quick way in PHP to find the maximum allowed POST data size for any server configuration that my script is running on?

For example, $max_post_length = $_SERVER['maxpost']; or something like that. Perhaps it will return 0 for "no limit" ... any ideas?

+7
source share
2 answers

Use ini_get .

 ini_get('post_max_size'); 
+19
source

Try the following:

 echo ini_get('post_max_size'); 

Or translate it into bytes:

 echo (int)(str_replace('M', '', ini_get('post_max_size')) * 1024 * 1024); 
+14
source

All Articles