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 >= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">php_ini_scanned_files</span> — <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'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"><?php<br /></span><span style="color: #007700">if (</span><span style="color: #0000BB">$filelist </span><span style="color: #007700">= </span><span style="color: #0000BB">php_ini_scanned_files</span><span style="color: #007700">()) {<br /> if (</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">$filelist</span><span style="color: #007700">) > </span><span style="color: #0000BB">0</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">$files </span><span style="color: #007700">= </span><span style="color: #0000BB">explode</span><span style="color: #007700">(</span><span style="color: #DD0000">','</span><span style="color: #007700">, </span><span style="color: #0000BB">$filelist</span><span style="color: #007700">);<br /><br /> foreach (</span><span style="color: #0000BB">$files </span><span style="color: #007700">as </span><span style="color: #0000BB">$file</span><span style="color: #007700">) {<br /> echo </span><span style="color: #DD0000">"<li>" </span><span style="color: #007700">. </span><span style="color: #0000BB">trim</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">) . </span><span style="color: #DD0000">"</li>\n"</span><span style="color: #007700">;<br /> }<br /> }<br />}<br /></span><span style="color: #0000BB">?></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(); ?>