<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.filter.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.filter-input-array.php',
    1 => 'filter_input_array',
    2 => '外部から変数を受け取り、オプションでそれらをフィルタリングする',
  ),
  'up' => 
  array (
    0 => 'ref.filter.php',
    1 => 'Filter 関数',
  ),
  'prev' => 
  array (
    0 => 'function.filter-input.php',
    1 => 'filter_input',
  ),
  'next' => 
  array (
    0 => 'function.filter-list.php',
    1 => 'filter_list',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/filter/functions/filter-input-array.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.filter-input-array" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">filter_input_array</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">filter_input_array</span> &mdash; <span class="dc-title">外部から変数を受け取り、オプションでそれらをフィルタリングする</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.filter-input-array-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>filter_input_array</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$type</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$options</code><span class="initializer"> = <strong><code><a href="filter.constants.php#constant.filter-default">FILTER_DEFAULT</a></code></strong></span></span>, <span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$add_empty</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span>|<span class="type"><a href="language.types.null.php" class="type null">null</a></span></span></div>

  <p class="para rdfs-comment">
   この関数を使用すると、大量のデータを取得する際に
   <span class="function"><a href="function.filter-input.php" class="function">filter_input()</a></span> を繰り返しコールする必要がなくなるので便利です。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.filter-input-array-parameters">
  <h3 class="title">パラメータ</h3>
  <dl>
   
    <dt><code class="parameter">type</code></dt>
    <dd>
     <span class="simpara">
      定数
      <strong><code><a href="filter.constants.php#constant.input-post">INPUT_<span class="replaceable">*</span></a></code></strong>
      のうちのひとつ。
     </span>
     <div class="warning"><strong class="warning">警告</strong>
      <p class="simpara">
       フィルタされるスーパーグローバルの内容は、
       ユーザーがスーパーグローバルに手を加える前の、
       <abbr title="Server Application Programming Interface">SAPI</abbr> が提供する &quot;生の&quot; ものです。
       変更されたスーパーグローバルの値をフィルタするには、
       <span class="function"><a href="function.filter-var-array.php" class="function">filter_var_array()</a></span> を代わりに使います。
      </p>
     </div>
    </dd>
   
   
    <dt><code class="parameter">options</code></dt>
    <dd>
     <span class="simpara">
      オプション、またはエントリごとに適用するフィルタの連想配列。
      フィルタは検証フィルタ
      <strong><code><a href="filter.constants.php#constant.filter-validate-bool">FILTER_VALIDATE_<span class="replaceable">*</span></a></code></strong>
      または除去フィルタ
      <strong><code><a href="filter.constants.php#constant.filter-sanitize-string">FILTER_SANITIZE_<span class="replaceable">*</span></a></code></strong>
      が使えます。
     </span>
     <span class="simpara">
      オプションの値は、
      <code class="parameter">array</code> に存在するキーをキーとして、
      そのエントリに適用するフィルタを値とする連想配列、
      または、そのエントリにどのフィルタを、
      どのように適用するかを記述した連想配列です。
     </span>
     <span class="simpara">
      どのようにフィルタを適用するかを連想配列に記述する場合、
      どのフィルタを対応する値に適用するかを <code class="literal">&#039;filter&#039;</code>
      キーに含めなければいけません。
      <code class="literal">&#039;filter&#039;</code> キーに指定できるのは、
      <strong><code><a href="filter.constants.php#constant.filter-validate-bool">FILTER_VALIDATE_<span class="replaceable">*</span></a></code></strong>,
      <strong><code><a href="filter.constants.php#constant.filter-sanitize-string">FILTER_SANITIZE_<span class="replaceable">*</span></a></code></strong>,
      <strong><code><a href="filter.constants.php#constant.filter-unsafe-raw">FILTER_UNSAFE_RAW</a></code></strong>,
      <strong><code><a href="filter.constants.php#constant.filter-callback">FILTER_CALLBACK</a></code></strong> のうちのいずれかです。
      オプションで <code class="literal">&#039;flags&#039;</code> キーには、
      フィルタに適用するフラグを指定できますし、
      <code class="literal">&#039;options&#039;</code> には、
      フィルタに適用するオプションを指定できます。
     </span>
    </dd>
   
   
    <dt><code class="parameter">add_empty</code></dt>
    <dd>
     <p class="para">
      返り値の配列に対して、キーが存在しない場合に <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> を追加します。
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.filter-input-array-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="simpara">
   成功した場合は要求された変数の値を含む配列。
  </p>
  <p class="simpara">
   失敗した場合、<strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返します。
   <code class="parameter">type</code> で指定された入力値の配列が得られなかった場合、
   かつ <strong><code><a href="filter.constants.php#constant.filter-null-on-failure">FILTER_NULL_ON_FAILURE</a></code></strong> フラグが指定されていた場合は、
   例外的に <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> を返します。
  </p>
  <p class="simpara">
   入力された配列に欠けているエントリがあった場合、
   <code class="parameter">add_empty</code> が <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> のときは返される配列に追加されます。
   この場合、欠けているエントリには、<strong><code><a href="filter.constants.php#constant.filter-null-on-failure">FILTER_NULL_ON_FAILURE</a></code></strong>
   を使わない限り <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> が設定されます。
   <strong><code><a href="filter.constants.php#constant.filter-null-on-failure">FILTER_NULL_ON_FAILURE</a></code></strong> を使った場合には、<strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> が設定されます。
  </p>
  <p class="simpara">
   フィルタが失敗した場合、配列の値は <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> になります。
   但し、<strong><code><a href="filter.constants.php#constant.filter-null-on-failure">FILTER_NULL_ON_FAILURE</a></code></strong> が使われている場合を除きます。
   使われている場合、配列の値は <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> になります。
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.filter-input-array-notes">
  <h3 class="title">注意</h3>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    <strong><code><a href="filter.constants.php#constant.input-server">INPUT_SERVER</a></code></strong> 配列には、
    キー <code class="literal">REQUEST_TIME</code> が存在しません。
    あとで <var class="varname"><a href="reserved.variables.server.php" class="classname">$_SERVER</a></var> に追加されるからです。
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.filter-input-array-seealso">
  <h3 class="title">参考</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.filter-input.php" class="function" rel="rdfs-seeAlso">filter_input()</a> - 指定した名前の変数を外部から受け取り、オプションでそれをフィルタリングする</span></li>
   <li><span class="function"><a href="function.filter-var.php" class="function" rel="rdfs-seeAlso">filter_var()</a> - 指定したフィルタでデータをフィルタリングする</span></li>
   <li><span class="function"><a href="function.filter-var-array.php" class="function" rel="rdfs-seeAlso">filter_var_array()</a> - 複数の変数を受け取り、オプションでそれらをフィルタリングする</span></li>
   <li>
    検証フィルタ
    <strong><code><a href="filter.constants.php#constant.filter-validate-bool">FILTER_VALIDATE_<span class="replaceable">*</span></a></code></strong>
   </li>
   <li>
    除去フィルタ
    <strong><code><a href="filter.constants.php#constant.filter-sanitize-string">FILTER_SANITIZE_<span class="replaceable">*</span></a></code></strong>
   </li>
  </ul>
 </div>


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