<?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 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.mb-strrichr.php',
    1 => 'mb_strrichr',
    2 => 'Finds the last occurrence of a character in a string within another, case insensitive',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => 'Multibyte String Functions',
  ),
  'prev' => 
  array (
    0 => 'function.mb-strrchr.php',
    1 => 'mb_strrchr',
  ),
  'next' => 
  array (
    0 => 'function.mb-strripos.php',
    1 => 'mb_strripos',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mbstring/functions/mb-strrichr.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mb-strrichr" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_strrichr</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mb_strrichr</span> &mdash; <span class="dc-title">Finds the last occurrence of a character in a string within another, case insensitive</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.mb-strrichr-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_strrichr</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_strrichr()</strong></span> finds the last occurrence of
   <code class="parameter">needle</code> in <code class="parameter">haystack</code>
   and returns the portion of <code class="parameter">haystack</code>. Unlike
   <span class="function"><a href="function.mb-strrchr.php" class="function">mb_strrchr()</a></span>, <span class="function"><strong>mb_strrichr()</strong></span> is
   case-insensitive.
   If <code class="parameter">needle</code> is not found, it returns <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.mb-strrichr-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">haystack</code></dt>
     <dd>
      <p class="para">
       The string from which to get the last occurrence
       of <code class="parameter">needle</code>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">needle</code></dt>
     <dd>
      <p class="para">
       The string to find in <code class="parameter">haystack</code>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">before_needle</code></dt>
     <dd>
      <p class="para">
       Determines which portion of <code class="parameter">haystack</code>
       this function returns. 
       If set to <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, it returns all of <code class="parameter">haystack</code>
       from the beginning to the last occurrence of <code class="parameter">needle</code>.
       If set to <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, it returns all of <code class="parameter">haystack</code>
       from the last occurrence of <code class="parameter">needle</code> to the end.
      </p>
     </dd>
    
    
     <dt><code class="parameter">encoding</code></dt>
     <dd>
      <p class="para">The <code class="parameter">encoding</code>
parameter is the character encoding. If it is omitted or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>, the internal character
encoding value will be used.</p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.mb-strrichr-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the portion of <code class="parameter">haystack</code>.
   or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> if <code class="parameter">needle</code> is not found.
  </p>
 </div>


 

 <div class="refsect1 changelog" id="refsect1-function.mb-strrichr-changelog">
  <h3 class="title">Changelog</h3>
  <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">needle</code> now accepts an empty string.
 </td>
</tr>

     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">encoding</code> is nullable now.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 


 <div class="refsect1 seealso" id="refsect1-function.mb-strrichr-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.mb-stristr.php" class="function" rel="rdfs-seeAlso">mb_stristr()</a> - Finds first occurrence of a string within another, case insensitive</span></li>
    <li><span class="function"><a href="function.mb-strrchr.php" class="function" rel="rdfs-seeAlso">mb_strrchr()</a> - Finds the last occurrence of a character in a string within another</span></li>
   </ul>
  </p>
 </div>

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