diff --git a/reference/info/functions/ini-get.xml b/reference/info/functions/ini-get.xml
index b14ac98f5abf..5f8163c87946 100644
--- a/reference/info/functions/ini-get.xml
+++ b/reference/info/functions/ini-get.xml
@@ -55,37 +55,15 @@
Our php.ini contains the following settings:
display_errors = On
-register_globals = Off
+opcache.enable_cli = Off
post_max_size = 8M
*/
echo 'display_errors = ' . ini_get('display_errors') . "\n";
-echo 'register_globals = ' . (int) ini_get('register_globals') . "\n";
+echo 'opcache.enable_cli = ' . (int) ini_get('opcache.enable_cli') . "\n";
echo 'post_max_size = ' . ini_get('post_max_size') . "\n";
echo 'post_max_size + 1 = ' . (rtrim(ini_get('post_max_size'), 'KMG') + 1) . "\n";
-echo 'post_max_size in bytes = ' . return_bytes(ini_get('post_max_size'));
-
-function return_bytes($val)
-{
- $val = trim($val);
- $num = (int) rtrim($val, 'KMG');
- $last = strtolower($val[strlen($val) - 1]);
-
- switch ($last) {
- // The 'G' modifier is available
- case 'g':
- $num = $num * 1024 * 1024 * 1024;
- break;
- case 'm':
- $num = $num * 1024 * 1024;
- break;
- case 'k':
- $num *= 1024;
- break;
- }
-
- return $num;
-}
+echo 'post_max_size in bytes = ' . ini_parse_quantity(ini_get('post_max_size'));
?>
]]>
@@ -95,7 +73,7 @@ function return_bytes($val)
ini_get will return the exact string stored in the
&php.ini; file and NOT its int
equivalent. Attempting normal arithmetic functions on these values
- will not have otherwise expected results. The example above shows one
- way to convert shorthand notation into bytes, much like how the PHP
- source does it.
+ will not have otherwise expected results. The
+ ini_parse_quantity function can be used to convert
+ the shorthand notation into bytes.
@@ -145,6 +123,7 @@ post_max_size in bytes = 8388608
get_cfg_var
ini_get_all
+ ini_parse_quantity
ini_restore
ini_set
diff --git a/reference/info/functions/ini-parse-quantity.xml b/reference/info/functions/ini-parse-quantity.xml
index c0357c86a817..fa4e018161f3 100644
--- a/reference/info/functions/ini-parse-quantity.xml
+++ b/reference/info/functions/ini-parse-quantity.xml
@@ -77,7 +77,7 @@ var_dump(ini_parse_quantity('10F'));
?>
]]>
- &example.outputs.similar;
+ &example.outputs;