Is there any way to get the byte values from the strings returned from functions like ini_get('upload_max_filesize') and ini_get('post_max_size') when they are using shorthand byte notation? For example get 4194304 from 4M ? I could hack together a function that does this but I would be surprised if there wasn’t some built in way of doing this.
Is there any way to get the byte values from the strings returned from
Share
The paragraph you linked to ends:
This leads you to something like this (which I have slightly modified):
Use it like so:
There is no built-in function to perform this task; recall that, really, INI settings are designed for use internally within PHP. The PHP source uses a similar function to the above.