mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
add the G ini modifier
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@174829 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
390f7ec06f
commit
eec09c9bb6
1 changed files with 6 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<!-- splitted from ./en/functions/info.xml, last change in rev 1.64 -->
|
||||
<refentry id="function.ini-get">
|
||||
<refnamediv>
|
||||
|
@ -60,16 +60,18 @@ echo 'post_max_size in bytes = ' . return_bytes(ini_get('post_max_size'));
|
|||
|
||||
function return_bytes($val) {
|
||||
$val = trim($val);
|
||||
$last = $val{strlen($val)-1};
|
||||
$last = strtolower($val{strlen($val)-1});
|
||||
switch($last) {
|
||||
case 'k':
|
||||
case 'K':
|
||||
return (int) $val * 1024;
|
||||
break;
|
||||
case 'm':
|
||||
case 'M':
|
||||
return (int) $val * 1048576;
|
||||
break;
|
||||
// The 'G' modifier is available since PHP 5.1.0
|
||||
case 'g':
|
||||
return (int) $val * 1073741824;
|
||||
break;
|
||||
default:
|
||||
return $val;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue