<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/filter.setup.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'filter.configuration.php',
    1 => '运行时配置',
    2 => '运行时配置',
  ),
  'up' => 
  array (
    0 => 'filter.setup.php',
    1 => '安装/配置',
  ),
  'prev' => 
  array (
    0 => 'filter.installation.php',
    1 => '安装',
  ),
  'next' => 
  array (
    0 => 'filter.constants.php',
    1 => '预定义常量',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/filter/ini.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="filter.configuration" class="section">
 <h2 class="title">运行时配置</h2>
 <p class="simpara">
这些函数的行为受 <var class="filename">php.ini</var> 中的设置影响。
</p>
 <p class="para">
  <table class="doctable table">
   <caption><strong>过滤器配置项</strong></caption>
   
    <thead>
     <tr>
      <th>名字</th>
      <th>默认</th>
      <th>可修改范围</th>
      <th>更新日志</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><a href="filter.configuration.php#ini.filter.default" class="link">filter.default</a></td>
      <td>&quot;unsafe_raw&quot;</td>
      <td><strong><code><a href="info.constants.php#constant.ini-perdir">INI_PERDIR</a></code></strong></td>
      <td>自 PHP 8.1.0 起弃用。</td>
     </tr>

     <tr>
      <td><a href="filter.configuration.php#ini.filter.default-flags" class="link">filter.default_flags</a></td>
      <td>NULL</td>
      <td><strong><code><a href="info.constants.php#constant.ini-perdir">INI_PERDIR</a></code></strong></td>
      <td class="empty">&nbsp;</td>
     </tr>

    </tbody>
   
  </table>

  有关 INI_* 样式的更多详情与定义，见 <a href="configuration.changes.modes.php" class="xref">配置可被设定范围</a>。
 </p>

 <p class="para">这是配置指令的简短说明。</p>

 <dl>
  
   <dt id="ini.filter.default">
    <code class="parameter">filter.default</code>
    <span class="type"><a href="language.types.string.php" class="type string">string</a></span>
   </dt>
   <dd>
    <p class="para">
     通过此过滤器过滤所有
     <var class="varname"><a href="reserved.variables.get.php" class="classname">$_GET</a></var>、<var class="varname"><a href="reserved.variables.post.php" class="classname">$_POST</a></var>、<var class="varname"><a href="reserved.variables.cookies.php" class="classname">$_COOKIE</a></var>、<var class="varname"><a href="reserved.variables.request.php" class="classname">$_REQUEST</a></var>
     和 <var class="varname"><a href="reserved.variables.server.php" class="classname">$_SERVER</a></var>。通过 <span class="function"><a href="function.filter-input.php" class="function">filter_input()</a></span> 访问原始数据。
    </p>
    <p class="para">
     必须是可以确定的过滤器名称，以便 <span class="function"><a href="function.filter-list.php" class="function">filter_list()</a></span> 和 <span class="function"><a href="function.filter-id.php" class="function">filter_id()</a></span> 使用。
    </p>
    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <span class="simpara">
      要小心默认过滤器的默认 flag。应该明确设置。例如，要将默认过滤器配置为跟
      <span class="function"><a href="function.htmlspecialchars.php" class="function">htmlspecialchars()</a></span> 完全相同，则必须将默认 flag
      设置为 <code class="literal">0</code>，如下所示。
     </span>
     <div class="example" id="example-1">
      <p><strong>示例 #1 配置默认过滤器的表现像 htmlspecialchars</strong></p>
      <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">filter.default = full_special_chars<br />filter.default_flags = 0</span></code></div>
      </div>

     </div>
    </p></blockquote>
    <div class="warning"><strong class="warning">警告</strong>
     <p class="simpara">
      此 INI 设置自 PHP 8.1.0 起弃用。
     </p>
    </div>
   </dd>
  
  
  
   <dt id="ini.filter.default-flags">
    <code class="parameter">filter.default_flags</code>
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
   </dt>
   <dd>
    <span class="simpara">
     设置默认过滤器时要应用的默认 flag。出于向后兼容性的原因，默认设置为 <strong><code><a href="filter.constants.php#constant.filter-flag-no-encode-quotes">FILTER_FLAG_NO_ENCODE_QUOTES</a></code></strong>。参阅
     <strong><code><a href="filter.constants.php#constant.filter-flag-none">FILTER_FLAG_<span class="replaceable">*</span></a></code></strong> 常量以了解可用的 flag。
    </span>
   </dd>
  
 </dl>
</div><?php manual_footer($setup); ?>