<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.filter.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'intro.filter.php',
    1 => 'Вступ',
    2 => 'Вступ',
  ),
  'up' => 
  array (
    0 => 'book.filter.php',
    1 => 'Filter',
  ),
  'prev' => 
  array (
    0 => 'book.filter.php',
    1 => 'Filter',
  ),
  'next' => 
  array (
    0 => 'filter.setup.php',
    1 => 'Встановлення/налаштування',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/filter/book.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="intro.filter" class="preface">
  <h1 class="title">Вступ</h1>
  <p class="simpara">
   This extension provides filters which can be used to validate or sanitize data.
   This is especially useful when the data source contains unknown (or foreign) data,
   like user supplied input.
   For example, this data may come from an <abbr title="Hyper Text Markup Language">HTML</abbr> form.
  </p>
  <p class="simpara">
   There are two main types of filtering:
   <em>validation</em> and <em>sanitization</em>.
  </p>
  <p class="simpara">
   A validation filter is used to check if the data meets certain criteria.
   These filters are identified by the
   <strong><code><a href="filter.constants.php#constant.filter-validate-bool">FILTER_VALIDATE_<span class="replaceable">*</span></a></code></strong>
   constants.
   For example, the <strong><code><a href="filter.constants.php#constant.filter-validate-email">FILTER_VALIDATE_EMAIL</a></code></strong> filter
   can be used to determine if the data is a valid email address.
   However, it will never alter the input data.
  </p>
  <p class="simpara">
   Sanitization on the other hand will &quot;clean up&quot; the data,
   therefore it may alter the input data by adding or removing characters.
   These filters are identified by the
   <strong><code><a href="filter.constants.php#constant.filter-sanitize-string">FILTER_SANITIZE_<span class="replaceable">*</span></a></code></strong>
   constants.
   For example, the <strong><code><a href="filter.constants.php#constant.filter-sanitize-email">FILTER_SANITIZE_EMAIL</a></code></strong> filter will
   remove characters that are inappropriate for an email address to contain.
   However, the sanitized data is not validated to check if it is a valid
   email address.
  </p>
  <p class="simpara">
   Most filters support optional <em>flags</em> that can tweak
   the behavior of the filter.
   These flags are identified by the
   <strong><code><a href="filter.constants.php#constant.filter-flag-none">FILTER_FLAG_<span class="replaceable">*</span></a></code></strong>
   constants.
   For example, using the <strong><code><a href="filter.constants.php#constant.filter-flag-path-required">FILTER_FLAG_PATH_REQUIRED</a></code></strong> with
   the <strong><code><a href="filter.constants.php#constant.filter-validate-url">FILTER_VALIDATE_URL</a></code></strong> validation filter
   requires that the <abbr title="Uniform Resource Locator">URL</abbr> has a path
   (e.g. <code class="literal">/foo</code> in <code class="literal">https://example.org/foo</code>).
  </p>
 </div><?php manual_footer($setup); ?>