<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.mbstring.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.mb-ereg-replace.php',
    1 => 'mb_ereg_replace',
    2 => 'Remplace des segments de cha&icirc;ne &agrave; l\'aide des expressions r&eacute;guli&egrave;res',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => 'Fonctions sur les cha&icirc;nes de caract&egrave;res multioctets',
  ),
  'prev' => 
  array (
    0 => 'function.mb-ereg-match.php',
    1 => 'mb_ereg_match',
  ),
  'next' => 
  array (
    0 => 'function.mb-ereg-replace-callback.php',
    1 => 'mb_ereg_replace_callback',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/mbstring/functions/mb-ereg-replace.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mb-ereg-replace" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_ereg_replace</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mb_ereg_replace</span> &mdash; <span class="dc-title">Remplace des segments de chaîne à l&#039;aide des expressions régulières</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.mb-ereg-replace-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_ereg_replace</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$pattern</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$replacement</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$string</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$options</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span><br>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</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="simpara">
   Recherche dans la chaîne <code class="parameter">string</code> des occurrences
   correspondant au motif <code class="parameter">pattern</code>,
   puis, les remplace avec le texte de remplacement <code class="parameter">replacement</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-ereg-replace-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">pattern</code></dt>
     <dd>
      <p class="para">
       L&#039;expression rationnelle.
      </p>
      <p class="para">
       Les caractères multi octets peuvent être utilisés dans
       <code class="parameter">pattern</code>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">replacement</code></dt>
     <dd>
      <p class="para">
       Le texte de remplacement.
      </p>
     </dd>
    
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       La chaîne à analyser.
      </p>
     </dd>
    
    
     <dt><code class="parameter">options</code></dt>
     <dd>
      <span class="simpara">
       L&#039;option de recherche. Pour plus d&#039;explications, consulter <span class="function"><a href="function.mb-regex-set-options.php" class="function">mb_regex_set_options()</a></span>.
      </span>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mb-ereg-replace-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   La chaîne résultante en cas de succès, ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une
   erreur survient.
   Si <code class="parameter">string</code> n&#039;est pas valide pour l&#039;encodage courant,
   <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> est retourné.
  </p>
 </div>

 
 <div class="refsect1 changelog" id="refsect1-function.mb-ereg-replace-changelog">
  <h3 class="title">Historique</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.0.0</td>
       <td>
        <code class="parameter">options</code> est désormais nullable.
       </td>
      </tr>

      <tr>
       <td>7.1.0</td>
       <td>
        Cette fonction vérifie si <code class="parameter">string</code> est valide pour
        l&#039;encodage courant.
       </td>
      </tr>

      <tr>
       <td>7.1.0</td>
       <td>
        Le modificateur <code class="literal">e</code> est désormais obsolète.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.mb-ereg-replace-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para">L&#039;encodage interne ou l&#039;encodage
    des caractères spécifié par la fonction <span class="function"><a href="function.mb-regex-encoding.php" class="function">mb_regex_encoding()</a></span> sera utilisé
    comme encodage de caractères pour cette fonction.</p></p></blockquote>
  <div class="warning"><strong class="warning">Avertissement</strong><p class="para">N&#039;utilisez jamais l&#039;option <code class="literal">e</code>
    lorsque vous travaillez avec des données entrantes. Aucune protection automatique n&#039;est appliquée
    (sous la forme de la fonction <span class="function"><a href="function.preg-replace.php" class="function">preg_replace()</a></span>). Si vous omettez cette étape, vous
    allez certainement crée des failles dans votre application.</p></div>
</div>


 <div class="refsect1 seealso" id="refsect1-function.mb-ereg-replace-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.mb-regex-encoding.php" class="function" rel="rdfs-seeAlso">mb_regex_encoding()</a> - D&eacute;finit/R&eacute;cup&egrave;re l'encodage des caract&egrave;res pour les expressions r&eacute;guli&egrave;res multioctets</span></li>
    <li><span class="function"><a href="function.mb-eregi-replace.php" class="function" rel="rdfs-seeAlso">mb_eregi_replace()</a> - Expression rationnelle avec support des caract&egrave;res multioctets, sans tenir compte de la casse</span></li>
   </ul>
  </p>
 </div>


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