开发者

PHP How to find maximum allowed POST data?

开发者 https://www.devze.com 2023-01-30 09:44 出处:网络
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?

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消