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

manual_header();
?>
<div id="function.php-ini-scanned-files" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">php_ini_scanned_files</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">php_ini_scanned_files</span> &mdash; <span class="dc-title">Return a list of .ini files parsed from the additional ini dir</span></p>

 </div>
 
 <a name="function.php-ini-scanned-files.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_scanned_files</b></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   <b>php_ini_scanned_files()</b> returns a comma-separated
   list of configuration files parsed after <var class="filename">php.ini</var>.  These files are
   found in a directory defined by the
   <span class="option">--with-config-file-scan-dir</span> option
   which is set during compilation.
  </p>
  <p class="para">
   The returned configuration files also include the path as declared in
   the <span class="option">--with-config-file-scan-dir</span>
   option.
  </p>
 </div>


 <a name="function.php-ini-scanned-files.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns a comma-separated string of .ini files on success. Each comma is
   followed by a newline. If the directive <span class="option">--with-config-file-scan-dir</span> wasn&#039;t set,
   <b><tt class="constant">FALSE</tt></b> is returned.  If it was set and the directory was empty, an
   empty string is returned.  If a file is unrecognizable, the file will
   still make it into the returned string but a PHP error will also result.
   This PHP error will be seen both at compile time and while using
   <b>php_ini_scanned_files()</b>.
  </p>
 </div>


 <a name="function.php-ini-scanned-files.examples"></a><div class="refsect1 examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Example #1 A simple example to list the returned ini files</b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">$filelist&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">php_ini_scanned_files</span><span style="color: #007700">())&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">$filelist</span><span style="color: #007700">)&nbsp;&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$files&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">explode</span><span style="color: #007700">(</span><span style="color: #DD0000">','</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$filelist</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;(</span><span style="color: #0000BB">$files&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$file</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;li&gt;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">trim</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"&lt;/li&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

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


 <a name="function.php-ini-scanned-files.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-set.php" class="function" rel="rdfs-seeAlso">ini_set()</a> - Sets the value of a configuration option</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="function.php-ini-loaded-file.php" class="function" rel="rdfs-seeAlso">php_ini_loaded_file()</a> - Retrieve a path to the loaded php.ini file</li>
   </ul><p>
  </p>
 </div>


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