<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.intl.grapheme.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ru',
  ),
  'this' => 
  array (
    0 => 'function.grapheme-strrpos.php',
    1 => 'grapheme_strrpos',
    2 => 'Вычисляет позицию последнего вхождения подстроки в графемных кластерах',
  ),
  'up' => 
  array (
    0 => 'ref.intl.grapheme.php',
    1 => 'Функции Grapheme',
  ),
  'prev' => 
  array (
    0 => 'function.grapheme-strripos.php',
    1 => 'grapheme_strripos',
  ),
  'next' => 
  array (
    0 => 'function.grapheme-strstr.php',
    1 => 'grapheme_strstr',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'reference/intl/grapheme/grapheme-strrpos.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.grapheme-strrpos" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">grapheme_strrpos</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8, PECL intl &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">grapheme_strrpos</span> &mdash; <span class="dc-title">Вычисляет позицию последнего вхождения подстроки в графемных кластерах</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.grapheme-strrpos-description">
  <h3 class="title">Описание</h3>
  <p class="para">Процедурный стиль</p>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>grapheme_strrpos</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.integer.php" class="type int">int</a></span> <code class="parameter">$offset</code><span class="initializer"> = 0</span></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">$locale</code><span class="initializer"> = &quot;&quot;</span></span><br>): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Функция находит позицию последнего вхождения подстроки. Позиция вычисляется в графемных кластерах.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.grapheme-strrpos-parameters">
  <h3 class="title">Список параметров</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">haystack</code></dt>
     <dd>
      <p class="para">
       Строка по стандарту UTF-8, в которой требуется найти подстроку.
      </p>
     </dd>
    
    
     <dt><code class="parameter">needle</code></dt>
     <dd>
      <p class="para">
       Подстрока по стандарту UTF-8, которую требуется найти.
      </p>
     </dd>
    
    
     <dt><code class="parameter">offset</code></dt>
     <dd>
      <p class="para">
       Необязательный параметр <code class="parameter">offset</code> указывает смещение,
       с которого начнётся поиск в строке <code class="parameter">haystack</code>. Смещение вычисляется в графемных кластерах, а не в байтах или символах.
       Отрицательные смещения отсчитываются с конца строки,
       но позиция по-прежнему вычисляется с начала строки <code class="parameter">haystack</code>, независимо от значения параметра <code class="parameter">offset</code>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">locale</code></dt>
     <dd>
      <span class="simpara">Идентификатор языковых и региональных параметров.</span>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.grapheme-strrpos-returnvalues">
  <h3 class="title">Возвращаемые значения</h3>
  <p class="para">
   Функция возвращает позицию в виде целого числа. Функция <span class="function"><strong>grapheme_strrpos()</strong></span>
   вернёт <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.grapheme-strrpos-changelog">
  <h3 class="title">Список изменений</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версия</th>
      <th>Описание</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.5.0</td>
 <td>
  Добавили необязательный параметр <code class="parameter">locale</code>.
 </td>
</tr>

     <tr>
      <td>7.1.0</td>
      <td>
       Параметр <code class="parameter">offset</code> теперь поддерживает отрицательные значения.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.grapheme-strrpos-examples">
  <h3 class="title">Примеры</h3>
  <div class="example" id="example-1">
   <p><strong>Пример #1 Пример поиска позиции последнего вхождения подстроки функцией <span class="function"><strong>grapheme_strrpos()</strong></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">// Символ | Название | Кодовая точка | Форма нормализации<br /><br />// å: 'LATIN SMALL LETTER A WITH RING ABOVE', U+00E5, NFD<br /></span><span style="color: #0000BB">$char_a_ring_nfd </span><span style="color: #007700">= </span><span style="color: #DD0000">"a\xCC\x8A"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// ö: 'LATIN SMALL LETTER O WITH DIAERESIS', U+00F6, NFD<br /></span><span style="color: #0000BB">$char_o_diaeresis_nfd </span><span style="color: #007700">= </span><span style="color: #DD0000">"o\xCC\x88"</span><span style="color: #007700">;<br /><br />print </span><span style="color: #0000BB">grapheme_strrpos</span><span style="color: #007700">(<br />    </span><span style="color: #0000BB">$char_a_ring_nfd </span><span style="color: #007700">. </span><span style="color: #0000BB">$char_o_diaeresis_nfd </span><span style="color: #007700">. </span><span style="color: #0000BB">$char_o_diaeresis_nfd</span><span style="color: #007700">,<br />    </span><span style="color: #0000BB">$char_o_diaeresis_nfd<br /></span><span style="color: #007700">);</span></span></code></div>
   </div>

  </div>
  
<p class="para">
 Результат выполнения приведённого примера:
</p>

  <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">2</pre>
</div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.grapheme-strrpos-seealso">
  <h3 class="title">Смотрите также</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.grapheme-stripos.php" class="function" rel="rdfs-seeAlso">grapheme_stripos()</a> - Вычисляет позицию первого вхождения подстроки в графемных кластерах без учёта регистра</span></li>
    <li><span class="function"><a href="function.grapheme-stristr.php" class="function" rel="rdfs-seeAlso">grapheme_stristr()</a> - Возвращает часть строки относительно первого вхождения подстроки без учёта регистра</span></li>
    <li><span class="function"><a href="function.grapheme-strpos.php" class="function" rel="rdfs-seeAlso">grapheme_strpos()</a> - Вычисляет позицию первого вхождения подстроки в графемных кластерах</span></li>
    <li><span class="function"><a href="function.grapheme-strripos.php" class="function" rel="rdfs-seeAlso">grapheme_strripos()</a> - Вычисляет позицию последнего вхождения подстроки в графемных кластерах без учёта регистра</span></li>
    <li><span class="function"><a href="function.grapheme-strstr.php" class="function" rel="rdfs-seeAlso">grapheme_strstr()</a> - Возвращает часть строки относительно первого вхождения подстроки</span></li>
    <li>
     <a href="http://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries" class="link external">&raquo;&nbsp;
      Сегментация текста в Юникоде: Границы графемных кластеров
     </a>
    </li>
   </ul>
  </p>
 </div>

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