<?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 => 'ru',
  ),
  'this' => 
  array (
    0 => 'function.mb-strrchr.php',
    1 => 'mb_strrchr',
    2 => 'Возвращает часть строки до или после последнего вхождения подстроки',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => 'Функции для работы с многобайтовыми строками',
  ),
  'prev' => 
  array (
    0 => 'function.mb-strpos.php',
    1 => 'mb_strpos',
  ),
  'next' => 
  array (
    0 => 'function.mb-strrichr.php',
    1 => 'mb_strrichr',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'reference/mbstring/functions/mb-strrchr.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mb-strrchr" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_strrchr</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mb_strrchr</span> &mdash; <span class="dc-title">
   Возвращает часть строки до или после последнего вхождения подстроки
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.mb-strrchr-description">
  <h3 class="title">Описание</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_strrchr</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">$haystack</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">$needle</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$before_needle</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong></span></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">$encoding</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></div>

  <p class="para rdfs-comment">
   Функция <span class="function"><strong>mb_strrchr()</strong></span> ищет в строке <code class="parameter">haystack</code>
   последнее вхождение подстроки <code class="parameter">needle</code>
   и возвращает часть строки <code class="parameter">haystack</code>.
   Функция возвращает значение <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, если строка не содержит подстроку <code class="parameter">needle</code>.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.mb-strrchr-parameters">
  <h3 class="title">Список параметров</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">haystack</code></dt>
     <dd>
      <p class="para">
       Строка, часть которой требуется получить — до или после последнего вхождения подстроки <code class="parameter">needle</code>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">needle</code></dt>
     <dd>
      <p class="para">
       Подстрока для поиска в строке <code class="parameter">haystack</code>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">before_needle</code></dt>
     <dd>
      <p class="para">
       Параметр определяет, какую часть строки <code class="parameter">haystack</code>
       возвращает функция. При установке значения <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> функция возвращает часть строки <code class="parameter">haystack</code>
       от начала до последнего вхождения подстроки <code class="parameter">needle</code>.
       При установке значения <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> возвращается часть строки <code class="parameter">haystack</code>
       от последнего вхождения подстроки <code class="parameter">needle</code> до конца строки.
      </p>
     </dd>
    
    
     <dt><code class="parameter">encoding</code></dt>
     <dd>
      
<p class="para">
 Параметр <code class="parameter">encoding</code> указывает кодировку символов.
 При пропуске параметра или передаче значения <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>
 функция интерпретирует символы в предустановленной кодировке модуля.
</p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.mb-strrchr-returnvalues">
  <h3 class="title">Возвращаемые значения</h3>
  <p class="para">
   Функция возвращает часть строки <code class="parameter">haystack</code> или значение <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>,
   если строка не содержит подстроку <code class="parameter">needle</code>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mb-strrchr-changelog">
  <h3 class="title">Список изменений</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версия</th>
      <th>Описание</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">needle</code> теперь принимает пустую строку.
 </td>
</tr>

     <tr>
 <td>8.0.0</td>
 <td>
  Параметр <code class="parameter">encoding</code> теперь принимает значение <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.mb-strrchr-seealso">
  <h3 class="title">Смотрите также</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.strrchr.php" class="function" rel="rdfs-seeAlso">strrchr()</a> - Находит последнее вхождение символа в строке</span></li>
    <li><span class="function"><a href="function.mb-strstr.php" class="function" rel="rdfs-seeAlso">mb_strstr()</a> - Возвращает часть строки до или после первого вхождения подстроки</span></li>
    <li><span class="function"><a href="function.mb-strrichr.php" class="function" rel="rdfs-seeAlso">mb_strrichr()</a> - Возвращает часть строки до или после последнего вхождения подстроки, без учёта регистра</span></li>
   </ul>
  </p>
 </div>


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