<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Finds the last occurrence of a character in a string within another, case insensitive</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.mb-strrchr.html">mb_strrchr</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.mb-strripos.html">mb_strripos</a></div> <div class="up"><a href="ref.mbstring.html">Multibyte String Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.mb-strrichr" class="refentry"> <div class="refnamediv"> <h1 class="refname">mb_strrichr</h1> <p class="verinfo">(PHP 5 >= 5.2.0)</p><p class="refpurpose"><span class="refname">mb_strrichr</span> — <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="type">string</span> <span class="methodname"><strong>mb_strrichr</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$haystack</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$needle</code></span> [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$part</code><span class="initializer"> = false</span></span> [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$encoding</code><span class="initializer"> = mb_internal_encoding()</span></span> ]] )</div> <p class="para rdfs-comment"> <span class="function"><strong>mb_strrichr()</strong></span> finds the last occurrence of <em><code class="parameter">needle</code></em> in <em><code class="parameter">haystack</code></em> and returns the portion of <em><code class="parameter">haystack</code></em>. Unlike <span class="function"><a href="function.mb-strrchr.html" class="function">mb_strrchr()</a></span>, <span class="function"><strong>mb_strrichr()</strong></span> is case-insensitive. If <em><code class="parameter">needle</code></em> is not found, it returns <strong><code>FALSE</code></strong>. </p> </div> <div class="refsect1 parameters" id="refsect1-function.mb-strrichr-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">haystack</code></em></span> <dd> <p class="para"> The string from which to get the last occurrence of <em><code class="parameter">needle</code></em> </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">needle</code></em></span> <dd> <p class="para"> The string to find in <em><code class="parameter">haystack</code></em> </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">part</code></em></span> <dd> <p class="para"> Determines which portion of <em><code class="parameter">haystack</code></em> this function returns. If set to <strong><code>TRUE</code></strong>, it returns all of <em><code class="parameter">haystack</code></em> from the beginning to the last occurrence of <em><code class="parameter">needle</code></em>. If set to <strong><code>FALSE</code></strong>, it returns all of <em><code class="parameter">haystack</code></em> from the last occurrence of <em><code class="parameter">needle</code></em> to the end, </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">encoding</code></em></span> <dd> <p class="para"> Character encoding name to use. If it is omitted, internal character encoding is used. </p> </dd> </dt> </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 <em><code class="parameter">haystack</code></em>. or <strong><code>FALSE</code></strong> if <em><code class="parameter">needle</code></em> is not found. </p> </div> <div class="refsect1 seealso" id="refsect1-function.mb-strrichr-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.mb-stristr.html" class="function" rel="rdfs-seeAlso">mb_stristr()</a> - Finds first occurrence of a string within another, case insensitive</span></li> <li class="member"> <span class="function"><a href="function.mb-strrchr.html" 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><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.mb-strrchr.html">mb_strrchr</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.mb-strripos.html">mb_strripos</a></div> <div class="up"><a href="ref.mbstring.html">Multibyte String Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>