Gets the value of a configuration option
Syntax
ini_get(string $option): string|false
Parameters
option
The configuration option name.
Return
Returns the value of the configuration option as a string on success, or an empty string for null values. Returns false if the configuration option doesn't exist.
Examples
1
<? $option = 'include_path'; $return = ini_get($option); echo $return; ?>
.:/opt/alt/php82/usr/share/pear:/opt/alt/php82/usr/share/php:/usr/share/pear:/usr/share/php
2
<? function bytes($size) { switch(strtolower(substr($size, -1))) { case 'g': $size *= 1024; case 'm': $size *= 1024; case 'k': $size *= 1024; } return $size; } $option = 'post_max_size'; $return = ini_get($option); echo "$option: $return\n"; echo "$option in bytes: " . bytes($return); ?>
post_max_size: 128M post_max_size in bytes: 134217728