<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.strings.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.str-ireplace.php',
    1 => 'str_ireplace',
    2 => 'Gro&szlig;- und kleinschreibungsunabh&auml;ngige Version von
   str_replace',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'String-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.str-increment.php',
    1 => 'str_increment',
  ),
  'next' => 
  array (
    0 => 'function.str-pad.php',
    1 => 'str_pad',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/strings/functions/str-ireplace.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.str-ireplace" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">str_ireplace</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">str_ireplace</span> &mdash; <span class="dc-title">
   Groß- und kleinschreibungsunabhängige Version von
   <span class="function"><a href="function.str-replace.php" class="function">str_replace()</a></span>
  </span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.str-ireplace-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>str_ireplace</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<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.string.php" class="type string">string</a></span></span> <code class="parameter">$search</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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.string.php" class="type string">string</a></span></span> <code class="parameter">$replace</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><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.array.php" class="type array">array</a></span></span> <code class="parameter">$subject</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter reference">&$count</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.array.php" class="type array">array</a></span></span></div>

  <p class="para rdfs-comment">
   Die Funktion gibt einen String oder ein Array zurück, in dem alle
   Vorkommen von <code class="parameter">search</code> innerhalb von
   <code class="parameter">subject</code> unabhängig von deren Groß- oder Kleinschreibung
   gegen den entsprechenden <code class="parameter">replace</code>-Wert ausgetauscht
   wurden.
  </p>
  <p class="para">
   Um Text anhand eines Musters statt einer konkreten Zeichenkette zu
   ersetzen, kann <span class="function"><a href="function.preg-replace.php" class="function">preg_replace()</a></span> mit dem
   <a href="reference.pcre.pattern.modifiers.php" class="link">Suchmuster-Modifikator</a>
   <code class="literal">i</code> verwendet werden.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.str-ireplace-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   Wenn <code class="parameter">search</code> und <code class="parameter">replace</code>
   Arrays sind, nimmt <span class="function"><strong>str_ireplace()</strong></span> einen Wert von jedem
   Array und sucht/ersetzt mit diesen im <code class="parameter">subject</code>. Wenn
   <code class="parameter">replace</code> weniger Werte als
   <code class="parameter">search</code> besitzt, wird eine leere Zeichenkette für die
   verbleibenden Ersetzungswerte verwendet. Wenn <code class="parameter">search</code>
   ein Array ist und <code class="parameter">replace</code> eine Zeichenkette, wird
   dieser Ersetzungswert für alle Werte des <code class="parameter">search</code>
   genutzt. Die Umkehrung jedoch wäre sinnlos.
  </p>
  <p class="para">
   Wenn <code class="parameter">search</code> oder <code class="parameter">replace</code>
   Arrays sind, werden ihre Elemente in aufsteigender Reihenfolge bearbeitet.
  </p>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">search</code></dt>
     <dd>
      <p class="para">
       Der gesuchte Wert, auch <em>Nadel (needle)</em> genannt.
       Ein Array kann genutzt werden, um mehrere Nadeln zu bestimmen.
      </p>
     </dd>
    
    
     <dt><code class="parameter">replace</code></dt>
     <dd>
      <p class="para">
       Der Ersetzungswert, der gefundene <code class="parameter">search</code>
       Werte ersetzt. Ein Array kann genutzt werden, um mehrere Nadeln zu
       bestimmen.
      </p>
     </dd>
    
    
     <dt><code class="parameter">subject</code></dt>
     <dd>
      <p class="para">
       Die zu durchsuchende und darin ersetzende Zeichenkette oder das Array,
       auch <em>Heuhaufen (haystack)</em> genannt.
      </p>
      <p class="para">
       Ist <code class="parameter">subject</code> ein Array, wird die
       Suchen-Ersetzen-Funktionalität auf jedes Element von
       <code class="parameter">subject</code> angewendet. Die Funktion gibt dann
       natürlich ein Array zurück.
      </p>
     </dd>
    
    
     <dt><code class="parameter">count</code></dt>
     <dd>
      <p class="para">
       Falls übergeben, wird dies auf die Anzahl der durchgeführten
       Ersetzungen gesetzt.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.str-ireplace-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt eine Zeichenkette oder ein Array mit ersetzten Werten zurück.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.str-ireplace-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     
 <tr>
  <td>8.2.0</td>
  <td>
   Die Groß- und Kleinschreibung hängt nicht mehr von der mit
   <span class="function"><a href="function.setlocale.php" class="function">setlocale()</a></span> eingestellten Locale ab. Es wird nur noch
   die Groß- und Kleinschreibung von ASCII-Bytes verglichen. Nicht-ASCII-Bytes
   werden nach ihrem Byte-Wert verglichen.
  </td>
 </tr>


    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.str-ireplace-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>str_ireplace()</strong></span>-Beispiel</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$bodytag </span><span style="color: #007700">= </span><span style="color: #0000BB">str_ireplace</span><span style="color: #007700">(</span><span style="color: #DD0000">"%body%"</span><span style="color: #007700">, </span><span style="color: #DD0000">"schwarz"</span><span style="color: #007700">, </span><span style="color: #DD0000">"&lt;body text=%BODY%&gt;"</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">$bodytag</span><span style="color: #007700">; </span><span style="color: #FF8000">// &lt;body text=schwarz&gt;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.str-ireplace-notes">
  <h3 class="title">Anmerkungen</h3>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: <span class="simpara">Diese Funktion ist
binärsicher.</span></p></blockquote>
  <div class="caution"><strong class="caution">Achtung</strong>
   <h1 class="title">Überraschende Reihenfolge der Ersetzungen</h1>
   <p class="para">
    Da <span class="function"><strong>str_ireplace()</strong></span> von links nach rechts ersetzt, kann
    sie einen zuvor behandelten Wert ersetzen, falls mehrere Ersetzungen
    durchgeführt werden. Beispiel #2 in der Dokumentation von
    <span class="function"><a href="function.str-replace.php" class="function">str_replace()</a></span> zeigt die Auswirkungen in der Praxis.
   </p>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.str-ireplace-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.str-replace.php" class="function" rel="rdfs-seeAlso">str_replace()</a> - Ersetzt alle Vorkommen des Suchstrings durch einen anderen String</span></li>
    <li><span class="function"><a href="function.preg-replace.php" class="function" rel="rdfs-seeAlso">preg_replace()</a> - Sucht und ersetzt mit regul&auml;ren Ausdr&uuml;cken</span></li>
    <li><span class="function"><a href="function.strtr.php" class="function" rel="rdfs-seeAlso">strtr()</a> - Tauscht Zeichen aus oder ersetzt Zeichenketten</span></li>
   </ul>
  </p>
 </div>


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