Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 4211

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!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 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-stripos.html">mb_stripos</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mb-strlen.html">mb_strlen</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-stristr" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_stristr</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0)</p><p class="refpurpose"><span class="refname">mb_stristr</span> &mdash; <span class="dc-title">Finds first occurrence of a string within another, case insensitive</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.mb-stristr-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>mb_stristr</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">$before_needle</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_stristr()</strong></span> finds the first 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-strstr.html" class="function">mb_strstr()</a></span>, 
    <span class="function"><strong>mb_stristr()</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-stristr-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 first 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">before_needle</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 first occurrence of <em><code class="parameter">needle</code></em> (excluding needle).
       If set to <strong><code>FALSE</code></strong>, it returns all of <em><code class="parameter">haystack</code></em>
       from the first occurrence of <em><code class="parameter">needle</code></em> to the end (including needle).
      </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-stristr-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-stristr-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.stristr.html" class="function" rel="rdfs-seeAlso">stristr()</a> - Case-insensitive strstr</span></li>
    <li class="member"> <span class="function"><a href="function.strstr.html" class="function" rel="rdfs-seeAlso">strstr()</a> - Find the first occurrence of a string</span></li>
    <li class="member"> <span class="function"><a href="function.mb-strstr.html" class="function" rel="rdfs-seeAlso">mb_strstr()</a> - Finds first occurrence of 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-stripos.html">mb_stripos</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mb-strlen.html">mb_strlen</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>