<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/filters.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'filters.string.php',
    1 => 'Filtres de cha&icirc;nes de caract&egrave;res',
    2 => 'Filtres de cha&icirc;nes de caract&egrave;res',
  ),
  'up' => 
  array (
    0 => 'filters.php',
    1 => 'Liste des filtres disponibles',
  ),
  'prev' => 
  array (
    0 => 'filters.php',
    1 => 'Liste des filtres disponibles',
  ),
  'next' => 
  array (
    0 => 'filters.convert.php',
    1 => 'Filtres de conversion',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'appendices/filters.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="filters.string" class="section">
  <h2 class="title">Filtres de chaînes de caractères</h2>

  <p class="simpara">
   Chaque filtre fait ce que son nom implique, et se réfère au
   comportement de la fonction PHP correspondante. Pour plus de
   détails sur un filtre, se reporter au manuel de la fonction
   de référence.
  </p>

  <div class="section" id="filters.string.rot13">
   <h2 class="title">string.rot13</h2>
   <p class="simpara">
    L&#039;utilisation de ce filtre est équivalente à traiter toutes les données
    du flux à travers la fonction <span class="function"><a href="function.str-rot13.php" class="function">str_rot13()</a></span>.
   </p>
   <div class="example" id="example-1">
    <p><strong>Exemple #1 string.rot13</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'php://output'</span><span style="color: #007700">, </span><span style="color: #DD0000">'w'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">stream_filter_append</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">'string.rot13'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">"Ceci est un test.\n"</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/* affiche :  Prpv rfg ha grfg.   */<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </div>

  <div class="section" id="filters.string.toupper">
   <h2 class="title">string.toupper</h2>
   <p class="simpara">
    L&#039;utilisation de ce filtre est équivalente à traiter toutes les données
    du flux à travers la fonction <span class="function"><a href="function.strtoupper.php" class="function">strtoupper()</a></span>.
   </p>
   <div class="example" id="example-2">
    <p><strong>Exemple #2 string.toupper</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'php://output'</span><span style="color: #007700">, </span><span style="color: #DD0000">'w'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">stream_filter_append</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">'string.toupper'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">"Ceci est un test.\n"</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/* affiche :  CECI EST UN TEST.   */<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </div>

  <div class="section" id="filters.string.tolower">
   <h2 class="title">string.tolower</h2>
   <p class="simpara">
    L&#039;utilisation de ce filtre est équivalente à traiter toutes les données
    du flux à travers la fonction <span class="function"><a href="function.strtolower.php" class="function">strtolower()</a></span>.
   </p>
   <div class="example" id="example-3">
    <p><strong>Exemple #3 string.tolower</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'php://output'</span><span style="color: #007700">, </span><span style="color: #DD0000">'w'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">stream_filter_append</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">'string.tolower'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">"Ceci est un test.\n"</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/* affiche :  ceci est un test.   */<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </div>

  <div class="section" id="filters.string.strip_tags">
   <h2 class="title">string.strip_tags</h2>
   <p class="simpara">
    L&#039;utilisation de ce filtre est équivalente à traiter toutes les données
    du flux à travers la fonction <span class="function"><a href="function.strip-tags.php" class="function">strip_tags()</a></span>.
    Le filtre accepte des paramètres sous deux formats :
    Soit comme une <a href="language.types.string.php" class="link">chaîne de caractères</a> contenant une liste de balises, similaire au
    second paramètre de la fonction <span class="function"><a href="function.strip-tags.php" class="function">strip_tags()</a></span>,
    soit en tant qu&#039;un <a href="language.types.array.php" class="link">tableau</a> de noms de balises.
   </p>
   <div class="warning"><strong class="warning">Avertissement</strong><p class="simpara">
 Cette fonctionnalité est <em>OBSOLÈTE</em> à partir de PHP 7.3.0.
 Dépendre de cette fonctionnalité est fortement déconseillé.
</p></div>
   <div class="example" id="example-4">
    <p><strong>Exemple #4 string.strip_tags</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'php://output'</span><span style="color: #007700">, </span><span style="color: #DD0000">'w'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">stream_filter_append</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">'string.strip_tags'</span><span style="color: #007700">, </span><span style="color: #0000BB">STREAM_FILTER_WRITE</span><span style="color: #007700">, </span><span style="color: #DD0000">"&lt;b&gt;&lt;i&gt;&lt;u&gt;"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">"&lt;b&gt;Ce texte en gras&lt;/b&gt; finit par être agrandi &lt;h1&gt;en un titre 1&lt;/h1&gt;\n"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/* affiche :  Ce texte en gras finit par être agrandi en un titre 1   */<br /><br /></span><span style="color: #0000BB">$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'php://output'</span><span style="color: #007700">, </span><span style="color: #DD0000">'w'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">stream_filter_append</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">'string.strip_tags'</span><span style="color: #007700">, </span><span style="color: #0000BB">STREAM_FILTER_WRITE</span><span style="color: #007700">, array(</span><span style="color: #DD0000">'b'</span><span style="color: #007700">,</span><span style="color: #DD0000">'i'</span><span style="color: #007700">,</span><span style="color: #DD0000">'u'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #DD0000">"&lt;b&gt;Ce texte en gras&lt;/b&gt; finit par être agrandi &lt;h1&gt;en un titre 1&lt;/h1&gt;\n"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/* affiche :  Ce texte en gras finit par être agrandi en un titre 1   */<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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