<?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 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.str-ireplace.php',
    1 => 'str_ireplace',
    2 => 'Case-insensitive version of str_replace',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'String Функції',
  ),
  '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' => 'en',
    '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">Case-insensitive version of <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">Опис</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">
   This function returns a string or an array with all occurrences of
   <code class="parameter">search</code> in <code class="parameter">subject</code>
   (ignoring case) replaced with the given <code class="parameter">replace</code>
   value.
   </p>
   <p class="para">
    To replace text based on a pattern rather than a fixed string,
    use <span class="function"><a href="function.preg-replace.php" class="function">preg_replace()</a></span> with the <code class="literal">i</code>
    <a href="reference.pcre.pattern.modifiers.php" class="link">pattern modifier</a>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.str-ireplace-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   If <code class="parameter">search</code> and <code class="parameter">replace</code> are
   arrays, then <span class="function"><strong>str_ireplace()</strong></span> takes a value from each
   array and uses them to search and replace on
   <code class="parameter">subject</code>. If <code class="parameter">replace</code> has fewer
   values than <code class="parameter">search</code>, then an empty string is used for
   the rest of replacement values. If <code class="parameter">search</code> is an
   array and <code class="parameter">replace</code> is a string, then this replacement
   string is used for every value of <code class="parameter">search</code>. The
   converse would not make sense, though.
  </p>
  <p class="para">
   If <code class="parameter">search</code> or <code class="parameter">replace</code>
   are arrays, their elements are processed first to last.
  </p>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">search</code></dt>
     <dd>
      <p class="para">
       The value being searched for, otherwise known as the
       <em>needle</em>.  An array may be used to designate
       multiple needles.
      </p>
     </dd>
    
    
     <dt><code class="parameter">replace</code></dt>
     <dd>
      <p class="para">
       The replacement value that replaces found <code class="parameter">search</code>
       values. An array may be used to designate multiple replacements.
      </p>
     </dd>
    
    
     <dt><code class="parameter">subject</code></dt>
     <dd>
      <p class="para">
       The string or array being searched and replaced on,
       otherwise known as the <em>haystack</em>.
      </p>
      <p class="para">
       If <code class="parameter">subject</code> is an array, then the search and
       replace is performed with every entry of 
       <code class="parameter">subject</code>, and the return value is an array as
       well.
      </p>
     </dd>
    
    
     <dt><code class="parameter">count</code></dt>
     <dd>
      <p class="para">
       If passed, this will be set to the number of replacements performed.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.str-ireplace-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Returns a string or an array of replacements.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.str-ireplace-changelog">
  <h3 class="title">Журнал змін</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версія</th>
      <th>Опис</th>
     </tr>

    </thead>

    <tbody class="tbody">
     
 <tr>
  <td>8.2.0</td>
  <td>
   Приведення до одного регістру не залежить від локалі, що встановлена функцією
   <span class="function"><a href="function.setlocale.php" class="function">setlocale()</a></span>. Перетворюються тільки ASCII-символи. Байти,
   які не належать до ASCII, порівнюються за своїми значеннями.
  </td>
 </tr>


    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.str-ireplace-examples">
  <h3 class="title">Приклади</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Приклад #1 <span class="function"><strong>str_ireplace()</strong></span> example</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">"black"</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=black&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">Примітки</h3>
  <blockquote class="note"><p><strong class="note">Зауваження</strong>: <span class="simpara">Ця функція є бінарно
безпечною.</span></p></blockquote>
  <div class="caution"><strong class="caution">Застереження</strong>
   <h1 class="title">Replacement order gotcha</h1>
   <p class="para">
    Because <span class="function"><strong>str_ireplace()</strong></span> replaces left to right, it might
    replace a previously inserted value when doing multiple replacements.
    Example #2 in the <span class="function"><a href="function.str-replace.php" class="function">str_replace()</a></span> documentation
    demonstrates how this may affect you in practice.
   </p>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.str-ireplace-seealso">
  <h3 class="title">Прогляньте також</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> - Replace all occurrences of the search string with the replacement string</span></li>
    <li><span class="function"><a href="function.preg-replace.php" class="function" rel="rdfs-seeAlso">preg_replace()</a> - Perform a regular expression search and replace</span></li>
    <li><span class="function"><a href="function.strtr.php" class="function" rel="rdfs-seeAlso">strtr()</a> - Перекладає символи або замінює підрядки</span></li>
   </ul>
  </p>
 </div>


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