downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/function.ini-restore.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/ref.info.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.ini-restore.php',
   
1 => 'ini_restore',
  ),
 
'up' =>
  array (
   
0 => 'ref.info.php',
   
1 => 'PHP Options/Info Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.ini-get.php',
   
1 => 'ini_get',
  ),
 
'next' =>
  array (
   
0 => 'function.ini-set.php',
   
1 => 'ini_set',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.ini-restore" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ini_restore</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">ini_restore</span> &mdash; <span class="dc-title">Restores the value of a configuration option</span></p>

 </div>
 
 <a name="function.ini-restore.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type"><span class="type void">void</span></span> <span class="methodname"><b>ini_restore</b></span>
    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$varname</tt></span>
   )</div>

  <p class="para rdfs-comment">
   Restores a given configuration option to its original value.
  </p>
 </div>


 <a name="function.ini-restore.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">varname</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       The configuration option name.
      </p>
     </dd>

   
   </dl>
<p>
  </p>
 </div>


 <a name="function.ini-restore.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   No value is returned.
  </p>
 </div>


 <a name="function.ini-restore.examples"></a><div class="refsect1 examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Example #1 <b>ini_restore()</b> example</b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$setting&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'y2k_compliance'</span><span style="color: #007700">;<br /><br />echo&nbsp;</span><span style="color: #DD0000">'Current&nbsp;value&nbsp;for&nbsp;\''&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$setting&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'\':&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #0000BB">$setting</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">ini_set</span><span style="color: #007700">(</span><span style="color: #0000BB">$setting</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #0000BB">$setting</span><span style="color: #007700">)&nbsp;?&nbsp;</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">'New&nbsp;value&nbsp;for&nbsp;\''&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$setting&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'\':&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #0000BB">$setting</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">ini_restore</span><span style="color: #007700">(</span><span style="color: #0000BB">$setting</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">'Original&nbsp;value&nbsp;for&nbsp;\''&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$setting&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'\':&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #0000BB">$setting</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents para"><p>The above example will output:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Current value for &#039;y2k_compliance&#039;: 1
New value for &#039;y2k_compliance&#039;: 0
Original value for &#039;y2k_compliance&#039;: 1
</pre></div>
    </div>
   </div><p>
  </p>
 </div>


 <a name="function.ini-restore.seealso"></a><div class="refsect1 seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   </p><ul class="simplelist">
    <li class="member"><a href="function.ini-get.php" class="function" rel="rdfs-seeAlso">ini_get()</a> - Gets the value of a configuration option</li>
    <li class="member"><a href="function.ini-get-all.php" class="function" rel="rdfs-seeAlso">ini_get_all()</a> - Gets all configuration options</li>
    <li class="member"><a href="function.ini-set.php" class="function" rel="rdfs-seeAlso">ini_set()</a> - Sets the value of a configuration option</li>
   </ul><p>
  </p>
 </div>


</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites