Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 4213

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>Find position of first occurrence of string in a string</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mb-strlen.html">mb_strlen</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mb-strrchr.html">mb_strrchr</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-strpos" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_strpos</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5)</p><p class="refpurpose"><span class="refname">mb_strpos</span> &mdash; <span class="dc-title">Find position of first occurrence of string in a string</span></p>

 </div>
   
 <div class="refsect1 description" id="refsect1-function.mb-strpos-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><strong>mb_strpos</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">
   Finds position of the first occurrence of a <span class="type"><a href="language.types.string.html" class="type string">string</a></span> in a <span class="type"><a href="language.types.string.html" class="type string">string</a></span>.
  </p>
  <p class="para">
   Performs a multi-byte safe
    <span class="function"><a href="function.strpos.html" class="function">strpos()</a></span> operation based on number of
   characters. The first character&#039;s position is 0, the second character
   position is 1, and so on. 
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-strpos-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 <span class="type"><a href="language.types.string.html" class="type string">string</a></span> being checked.
      </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>. In contrast
       with  <span class="function"><a href="function.strpos.html" class="function">strpos()</a></span>, numeric values are not applied
       as the ordinal value of a character.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">offset</code></em></span>
     <dd>

      <p class="para">
       The search offset. If it is not specified, 0 is used.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">encoding</code></em></span>
     <dd>

      <p class="para">The <em><code class="parameter">encoding</code></em>
parameter is the character encoding. If it is omitted, the internal character
encoding value will be used.</p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mb-strpos-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the numeric position of
   the first occurrence of <em><code class="parameter">needle</code></em> in the
   <em><code class="parameter">haystack</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span>. If
   <em><code class="parameter">needle</code></em> is not found, it returns <strong><code>FALSE</code></strong>.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.mb-strpos-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.mb-internal-encoding.html" class="function" rel="rdfs-seeAlso">mb_internal_encoding()</a> - Set/Get internal character encoding</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>
   </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-strlen.html">mb_strlen</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mb-strrchr.html">mb_strrchr</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>