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?
$max_post_length = $_SERVER['maxpost'];
0
Use ini_get .
ini_get
ini_get('post_max_size');
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);