<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = 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 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.get-included-files.php',
    1 => 'get_included_files',
    2 => 'include または require で読み込まれたファイルの名前を配列として返す',
  ),
  'up' => 
  array (
    0 => 'ref.info.php',
    1 => 'PHP オプション/情報 関数',
  ),
  'prev' => 
  array (
    0 => 'function.get-include-path.php',
    1 => 'get_include_path',
  ),
  'next' => 
  array (
    0 => 'function.get-loaded-extensions.php',
    1 => 'get_loaded_extensions',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/info/functions/get-included-files.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.get-included-files" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">get_included_files</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">get_included_files</span> &mdash; <span class="dc-title">include または require で読み込まれたファイルの名前を配列として返す</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.get-included-files-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>get_included_files</strong></span>(): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   この関数は、
   <span class="function"><a href="function.include.php" class="function">include</a></span>、<span class="function"><a href="function.include-once.php" class="function">include_once</a></span>、
   <span class="function"><a href="function.require.php" class="function">require</a></span> あるいは <span class="function"><a href="function.require-once.php" class="function">require_once</a></span>
   によりスクリプトにロードされたすべてのファイルの名前を取得します。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.get-included-files-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">この関数にはパラメータはありません。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.get-included-files-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   すべてのファイル名を含む配列を返します。
  </p>
  <p class="para">
   最初にコールされたスクリプトは &quot;include されたファイル&quot; という扱いに
   なります。そのため、
   <span class="function"><a href="function.include.php" class="function">include</a></span> やその仲間たちにより
   読み込まれたファイルの一覧に含めて表示されます。
  </p>
  <p class="para">
   複数回読み込まれているファイルも、
   返される配列には一度しかあらわれません。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.get-included-files-examples">
  <h3 class="title">例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>例1 <span class="function"><strong>get_included_files()</strong></span> の例</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// このファイルは abc.php です<br /><br /></span><span style="color: #007700">include </span><span style="color: #DD0000">'test1.php'</span><span style="color: #007700">;<br />include_once </span><span style="color: #DD0000">'test2.php'</span><span style="color: #007700">;<br />require </span><span style="color: #DD0000">'test3.php'</span><span style="color: #007700">;<br />require_once </span><span style="color: #DD0000">'test4.php'</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$included_files </span><span style="color: #007700">= </span><span style="color: #0000BB">get_included_files</span><span style="color: #007700">();<br /><br />foreach (</span><span style="color: #0000BB">$included_files </span><span style="color: #007700">as </span><span style="color: #0000BB">$filename</span><span style="color: #007700">) {<br />    echo </span><span style="color: #DD0000">"</span><span style="color: #0000BB">$filename</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>上の例の出力は以下となります。</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">/path/to/abc.php
/path/to/test1.php
/path/to/test2.php
/path/to/test3.php
/path/to/test4.php</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.get-included-files-seealso">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.include.php" class="function" rel="rdfs-seeAlso">include</a> - include</span></li>
    <li><span class="function"><a href="function.include-once.php" class="function" rel="rdfs-seeAlso">include_once</a> - include_once</span></li>
    <li><span class="function"><a href="function.require.php" class="function" rel="rdfs-seeAlso">require</a> - require</span></li>
    <li><span class="function"><a href="function.require-once.php" class="function" rel="rdfs-seeAlso">require_once</a> - require_once</span></li>
    <li><span class="function"><a href="function.get-required-files.php" class="function" rel="rdfs-seeAlso">get_required_files()</a> - get_included_files のエイリアス</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>