array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.ini-restore.php', 1 => 'ini_restore', ), 'up' => array ( 0 => 'ref.info.php', 1 => 'PHP 选项/信息 函数', ), 'prev' => array ( 0 => 'function.ini-parse-quantity.php', 1 => 'ini_parse_quantity', ), 'next' => array ( 0 => 'function.ini-set.php', 1 => 'ini_set', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/info/functions/ini-restore.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
ini_restore — 恢复配置选项的值
option
配置选项名称。
没有返回值。
示例 #1 ini_restore() 示例
<?php
$setting = 'html_errors';
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;
?>
以上示例会输出:
Current value for 'html_errors': 1 New value for 'html_errors': 0 Original value for 'html_errors': 1