PHP How to find maximum allowed POST data?
In PHP, is there a quick way to find th开发者_Python百科e maximum allowed size of POST data for any server configuration that my script is run on?
For example, $max_post_length = $_SERVER['maxpost'];
or something. Perhaps it would return 0
for 'no limit'...any ideas?
Use ini_get
.
ini_get('post_max_size');
Try this:
echo ini_get('post_max_size');
Or translate it to bytes:
echo (int)(str_replace('M', '', ini_get('post_max_size')) * 1024 * 1024);
精彩评论