Sophie

Sophie

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

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 (in grapheme units) of first occurrence of a case-insensitive string</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.grapheme-extract.html">grapheme_extract</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.grapheme-stristr.html">grapheme_stristr</a></div>
 <div class="up"><a href="ref.intl.grapheme.html">Grapheme Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.grapheme-stripos" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">grapheme_stripos</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">grapheme_stripos</span> &mdash; <span class="dc-title">Find position (in grapheme units) of first occurrence of a case-insensitive string</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.grapheme-stripos-description">
  <h3 class="title">Description</h3>
  <p class="para">Procedural style</p>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><strong>grapheme_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>
  ] )</div>

  <p class="para rdfs-comment">
   Find position (in grapheme units) of first occurrence of a case-insensitive string
  </p> 
 </div>


 <div class="refsect1 parameters" id="refsect1-function.grapheme-stripos-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 to look in. Must be valid UTF-8.
      </p>
     </dd>

    </dt>

    <dt>

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

      <p class="para">
       The string to look for. Must be valid UTF-8. 
      </p>
     </dd>

    </dt>

    <dt>

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

      <p class="para">
       The optional $offset parameter allows you to specify where in haystack to
       start searching as an offset in grapheme units (not bytes or characters).
       The position returned is still relative to the beginning of haystack
       regardless of the value of $offset.
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>

   
 
 <div class="refsect1 returnvalues" id="refsect1-function.grapheme-stripos-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the position as an integer. If needle is not found, grapheme_stripos() will return boolean FALSE.   
  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-function.grapheme-stripos-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="example-2679">
   <p><strong>Example #1  <span class="function"><strong>grapheme_stripos()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$char_a_ring_nfd&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"a\xCC\x8A"</span><span style="color: #007700">;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;'LATIN&nbsp;SMALL&nbsp;LETTER&nbsp;A&nbsp;WITH&nbsp;RING&nbsp;ABOVE'&nbsp;(U+00E5)&nbsp;normalization&nbsp;form&nbsp;"D"<br /></span><span style="color: #0000BB">$char_o_diaeresis_nfd&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"o\xCC\x88"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;'LATIN&nbsp;SMALL&nbsp;LETTER&nbsp;O&nbsp;WITH&nbsp;DIAERESIS'&nbsp;(U+00F6)&nbsp;normalization&nbsp;form&nbsp;"D"<br /></span><span style="color: #0000BB">$char_O_diaeresis_nfd&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"O\xCC\x88"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;'LATIN&nbsp;CAPITAL&nbsp;LETTER&nbsp;O&nbsp;WITH&nbsp;DIAERESIS'&nbsp;(U+00D6)&nbsp;normalization&nbsp;form&nbsp;"D"<br /><br /></span><span style="color: #007700">print&nbsp;</span><span style="color: #0000BB">grapheme_stripos</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$char_a_ring_nfd&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$char_a_ring_nfd&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$char_o_diaeresis_nfd</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$char_O_diaeresis_nfd</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

  </div>
  <p class="para">The above example will output:</p>
  <div class="example-contents screen">
<div class="cdata"><pre>
2
</pre></div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.grapheme-stripos-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.grapheme-stristr.html" class="function" rel="rdfs-seeAlso">grapheme_stristr()</a> - Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack.</span></li>
    <li class="member"> <span class="function"><a href="function.grapheme-strpos.html" class="function" rel="rdfs-seeAlso">grapheme_strpos()</a> - Find position (in grapheme units) of first occurrence of a string</span></li>
    <li class="member"> <span class="function"><a href="function.grapheme-strripos.html" class="function" rel="rdfs-seeAlso">grapheme_strripos()</a> - Find position (in grapheme units) of last occurrence of a case-insensitive string</span></li>
    <li class="member"> <span class="function"><a href="function.grapheme-strrpos.html" class="function" rel="rdfs-seeAlso">grapheme_strrpos()</a> - Find position (in grapheme units) of last occurrence of a string</span></li>
    <li class="member"> <span class="function"><a href="function.grapheme-strstr.html" class="function" rel="rdfs-seeAlso">grapheme_strstr()</a> - Returns part of haystack string from the first occurrence of needle to the end of haystack.</span></li>
    <li class="member">
     <a href="http://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries" class="link external">&raquo;&nbsp;
      Unicode Text Segmentation: Grapheme Cluster Boundaries
     </a>
    </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.grapheme-extract.html">grapheme_extract</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.grapheme-stristr.html">grapheme_stristr</a></div>
 <div class="up"><a href="ref.intl.grapheme.html">Grapheme Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>