downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/function.iconv-strrpos.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/ref.iconv.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.iconv-strrpos.php',
   
1 => 'iconv_strrpos',
  ),
 
'up' =>
  array (
   
0 => 'ref.iconv.php',
   
1 => 'iconv Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.iconv-strpos.php',
   
1 => 'iconv_strpos',
  ),
 
'next' =>
  array (
   
0 => 'function.iconv-substr.php',
   
1 => 'iconv_substr',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.iconv-strrpos" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">iconv_strrpos</h1>
  <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">iconv_strrpos</span> &mdash; <span class="dc-title">Finds the last occurrence of a needle within a haystack</span></p>

 </div>
 
 <a name="function.iconv-strrpos.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><b>iconv_strrpos</b></span>
    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$haystack</tt></span>
   , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$needle</tt></span>
   [, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$charset</tt><span class="initializer"> = ini_set(&quot;iconv.internal_encoding&quot;)</span></span>
  ] )</div>

  <p class="para rdfs-comment">
   In contrast to <a href="function.strpos.php" class="function">strpos()</a>, the return value of
   <b>iconv_strrpos()</b> is the number of characters that
   appear before the needle, rather than the offset in bytes to the
   position where the needle has been found.
  </p>
 </div>


 <a name="function.iconv-strrpos.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">haystack</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       The entire string.
      </p>
     </dd>

   
    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">needle</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       The searched substring.
      </p>
     </dd>

   
    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">charset</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       If <i><tt class="parameter">charset</tt></i>
 parameter is omitted,
       <i><tt class="parameter">string</tt></i>
 are assumed to be encoded in
       <a href="iconv.configuration.php" class="link">iconv.internal_encoding</a>.
      </p>
     </dd>

   
   </dl>
<p>
  </p>
  <p class="para">
   If <i><tt class="parameter">haystack</tt></i>
 or <i><tt class="parameter">needle</tt></i>
 is
   not a string, it is converted to a string and applied as the ordinal
   value of a character.
  </p>
 </div>


 <a name="function.iconv-strrpos.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the numeric position of the last occurrence of
   <i><tt class="parameter">needle</tt></i>
 in <i><tt class="parameter">haystack</tt></i>
.
   The characters are counted
   on the basis of the specified character set <i><tt class="parameter">charset</tt></i>
.
  </p>
  <p class="para">
   If <i><tt class="parameter">needle</tt></i>
 is not found,
   <b>iconv_strrpos()</b> will return <b><tt class="constant">FALSE</tt></b>.
  </p>
  <div class="warning"><b class="warning">Warning</b><p class="simpara">This function may
return Boolean <b><tt class="constant">FALSE</tt></b>, but may also return a non-Boolean value which
evaluates to <b><tt class="constant">FALSE</tt></b>, such as <i>0</i> or
&quot;&quot;. Please read the section on <a href="language.types.boolean.php" class="link">Booleans</a> for more
information. Use <a href="language.operators.comparison.php" class="link">the ===
operator</a> for testing the return value of this
function.</p></div>
 </div>


 <a name="function.iconv-strrpos.seealso"></a><div class="refsect1 seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   </p><ul class="simplelist">
    <li class="member"><a href="function.strrpos.php" class="function" rel="rdfs-seeAlso">strrpos()</a> - Find position of last occurrence of a char in a string</li>
    <li class="member"><a href="function.iconv-strpos.php" class="function" rel="rdfs-seeAlso">iconv_strpos()</a> - Finds position of first occurrence of a needle within a haystack</li>
    <li class="member"><a href="function.mb-strrpos.php" class="function" rel="rdfs-seeAlso">mb_strrpos()</a> - Find position of last occurrence of a string in a string</li>
   </ul><p>
  </p>
 </div>


</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites