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.php-ini-loaded-file.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.php-ini-loaded-file.php',
   
1 => 'php_ini_loaded_file',
  ),
 
'up' =>
  array (
   
0 => 'ref.info.php',
   
1 => 'PHP Options/Info Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.memory-get-usage.php',
   
1 => 'memory_get_usage',
  ),
 
'next' =>
  array (
   
0 => 'function.php-ini-scanned-files.php',
   
1 => 'php_ini_scanned_files',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.php-ini-loaded-file" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">php_ini_loaded_file</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.4)</p><p class="refpurpose"><span class="refname">php_ini_loaded_file</span> &mdash; <span class="dc-title">Retrieve a path to the loaded php.ini file</span></p>

 </div>
 
 <a name="function.php-ini-loaded-file.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><b>php_ini_loaded_file</b></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   Check if a <var class="filename">php.ini</var> file is loaded, and retrieve its path.
  </p>
 </div>


 <a name="function.php-ini-loaded-file.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">This function has no parameters.</p>
 </div>


 <a name="function.php-ini-loaded-file.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   The loaded <var class="filename">php.ini</var> path, or <b><tt class="constant">FALSE</tt></b> if one is not loaded.
  </p>
 </div>


 <a name="function.php-ini-loaded-file.examples"></a><div class="refsect1 examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Example #1 <b>php_ini_loaded_file()</b> example</b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$inipath&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">php_ini_loaded_file</span><span style="color: #007700">();<br /><br />if&nbsp;(</span><span style="color: #0000BB">$inipath</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'Loaded&nbsp;php.ini:&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$inipath</span><span style="color: #007700">;<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'A&nbsp;php.ini&nbsp;file&nbsp;is&nbsp;not&nbsp;loaded'</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents para"><p>The above example will output
something similar to:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Loaded php.ini: /usr/local/php/php.ini
</pre></div>
    </div>
   </div><p>
  </p>
 </div>


 <a name="function.php-ini-loaded-file.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.php-ini-scanned-files.php" class="function" rel="rdfs-seeAlso">php_ini_scanned_files()</a> - Return a list of .ini files parsed from the additional ini dir</li>
    <li class="member"><a href="function.phpinfo.php" class="function" rel="rdfs-seeAlso">phpinfo()</a> - Outputs lots of PHP information</li>
    <li class="member"><a href="configuration.file.php" class="link">The configuration file</a></li>
   </ul><p>
  </p>
 </div>


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