<!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 position of first occurrence of 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-strimwidth.html">mb_strimwidth</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.mb-stristr.html">mb_stristr</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-stripos" class="refentry"> <div class="refnamediv"> <h1 class="refname">mb_stripos</h1> <p class="verinfo">(PHP 5 >= 5.2.0, PHP 7)</p><p class="refpurpose"><span class="refname">mb_stripos</span> — <span class="dc-title">Finds position of first occurrence of a string within another, case insensitive</span></p> </div> <div class="refsect1 description" id="refsect1-function.mb-stripos-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">int</span> <span class="methodname"><strong>mb_stripos</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">int</span> <code class="parameter">$offset</code><span class="initializer"> = 0</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_stripos()</strong></span> returns the numeric position of the first occurrence of <code class="parameter">needle</code> in the <code class="parameter">haystack</code> string. Unlike <span class="function"><a href="function.mb-strpos.html" class="function">mb_strpos()</a></span>, <span class="function"><strong>mb_stripos()</strong></span> is case-insensitive. If <code class="parameter">needle</code> is not found, it returns <strong><code>FALSE</code></strong>. </p> </div> <div class="refsect1 parameters" id="refsect1-function.mb-stripos-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 position of the first 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">offset</code></dt> <dd> <p class="para"> The position in <code class="parameter">haystack</code> to start searching. A negative offset counts from the end of the string. </p> </dd> <dt> <code class="parameter">encoding</code></dt> <dd> <p class="para"> Character encoding name to use. If it is omitted, internal character encoding is used. </p> </dd> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.mb-stripos-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Return the numeric position of the first occurrence of <code class="parameter">needle</code> in the <code class="parameter">haystack</code> string, or <strong><code>FALSE</code></strong> if <code class="parameter">needle</code> is not found. </p> </div> <div class="refsect1 changelog" id="refsect1-function.mb-stripos-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>7.1.0</td> <td> Support for negative <code class="parameter">offset</code>s has been added. </td> </tr> </tbody> </table> </div> <div class="refsect1 seealso" id="refsect1-function.mb-stripos-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><span class="function"><a href="function.stripos.html" class="function" rel="rdfs-seeAlso">stripos()</a> - Find the position of the first occurrence of a case-insensitive substring in a string</span></li> <li class="member"><span class="function"><a href="function.strpos.html" class="function" rel="rdfs-seeAlso">strpos()</a> - Find the position of the first occurrence of a substring in a string</span></li> <li class="member"><span class="function"><a href="function.mb-strpos.html" class="function" rel="rdfs-seeAlso">mb_strpos()</a> - Find position of first occurrence of string in a string</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-strimwidth.html">mb_strimwidth</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.mb-stristr.html">mb_stristr</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>