ini_restore

(PHP 4, PHP 5, PHP 7)
Restores the value of a configuration option
void ini_restore ( string $varname )

Restores a given configuration option to its original value.

Parameters:
varname

The configuration option name.

Returns:

No value is returned.

Examples:
ini_restore() example
<?php
$setting = 'y2k_compliance';

echo 'Current value for \'' . $setting . '\': ' . ini_get($setting), PHP_EOL;

ini_set($setting, ini_get($setting) ? 0 : 1);
echo 'New value for \'' . $setting . '\': ' . ini_get($setting), PHP_EOL;

ini_restore($setting);
echo 'Original value for \'' . $setting . '\': ' . ini_get($setting), PHP_EOL;
?>

The above example will output:

Current value for 'y2k_compliance': 1
New value for 'y2k_compliance': 0
Original value for 'y2k_compliance': 1
See also:

ini_get() -

ini_get_all() -

ini_set() -

doc_php
2016-02-24 15:54:01
Comments
Leave a Comment

Please login to continue.