简体   繁体   中英

In a php.ini file there is '2M' where I expect a number - what does it mean?

My employer needs a change to some PHP files that lead me to need to look in the 'php.ini' file which I have never done before. The line I care about is:

upload_max_filesize = 2M

Does '2M' mean 2 million? If not, what does it mean? I don't need to change it, I just need to know what number it represents.

2 megabytes. I don't know if that's 2^20 bytes or 10^6 bytes, but that doesn't really make much of a difference.

This is a PHP shorthand byte value. You can find out more from http://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes

2M is 2 megabytes (2*1024*1024)

You can read about it here and here

2M=2*2^10 BYTES . This is the default MAX SIZE for UPLOAD defined by PHP , which can be changed to any number you like

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM