/php/function.iconv-strrpos.html
https://bitbucket.org/stillzhl/manuals · HTML · 131 lines · 105 code · 26 blank · 0 comment · 0 complexity · 01f6fd755d61e20bf1fb56028eb64a66 MD5 · raw file
- <!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 the last occurrence of a needle within a haystack</title>
- </head>
- <body><div class="manualnavbar" style="text-align: center;">
- <div class="prev" style="text-align: left; float: left;"><a href="function.iconv-strpos.html">iconv_strpos</a></div>
- <div class="next" style="text-align: right; float: right;"><a href="function.iconv-substr.html">iconv_substr</a></div>
- <div class="up"><a href="ref.iconv.html">iconv 函数</a></div>
- <div class="home"><a href="index.html">PHP Manual</a></div>
- </div><hr /><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> — <span class="dc-title">Finds the last occurrence of a needle within a haystack</span></p>
- </div>
-
- <div class="refsect1 description" id="refsect1-function.iconv-strrpos-description">
- <h3 class="title">说明</h3>
- <div class="methodsynopsis dc-description">
- <span class="type">int</span> <span class="methodname"><strong>iconv_strrpos</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">string</span> <code class="parameter">$charset</code><span class="initializer"> = ini_get("iconv.internal_encoding")</span></span>
- ] )</div>
- <p class="para rdfs-comment">
- Finds the last occurrence of a <em><code class="parameter">needle</code></em>
- within a <em><code class="parameter">haystack</code></em>.
- </p>
- <p class="para">
- In contrast to <span class="function"><a href="function.strrpos.html" class="function">strrpos()</a></span>, the return value of
- <span class="function"><strong>iconv_strrpos()</strong></span> 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. The characters are counted
- on the basis of the specified character set <em><code class="parameter">charset</code></em>.
- </p>
- </div>
- <div class="refsect1 parameters" id="refsect1-function.iconv-strrpos-parameters">
- <h3 class="title">参数</h3>
- <p class="para">
- <dl>
- <dt>
- <span class="term"><em><code class="parameter">haystack</code></em></span>
- <dd>
- <p class="para">
- The entire string.
- </p>
- </dd>
- </dt>
- <dt>
- <span class="term"><em><code class="parameter">needle</code></em></span>
- <dd>
- <p class="para">
- The searched substring.
- </p>
- </dd>
- </dt>
- <dt>
- <span class="term"><em><code class="parameter">charset</code></em></span>
- <dd>
- <p class="para">
- If <em><code class="parameter">charset</code></em> parameter is omitted,
- <em><code class="parameter">string</code></em> are assumed to be encoded in
- <a href="iconv.configuration.html" class="link">iconv.internal_encoding</a>.
- </p>
- </dd>
- </dt>
- </dl>
- </p>
- <p class="para">
- If <em><code class="parameter">haystack</code></em> or <em><code class="parameter">needle</code></em> is
- not a string, it is converted to a string and applied as the ordinal
- value of a character.
- </p>
- </div>
- <div class="refsect1 returnvalues" id="refsect1-function.iconv-strrpos-returnvalues">
- <h3 class="title">返回值</h3>
- <p class="para">
- Returns the numeric position of the last occurrence of
- <em><code class="parameter">needle</code></em> in <em><code class="parameter">haystack</code></em>.
- </p>
- <p class="para">
- If <em><code class="parameter">needle</code></em> is not found,
- <span class="function"><strong>iconv_strrpos()</strong></span> will return <strong><code>FALSE</code></strong>.
- </p>
- <div class="warning"><strong class="warning">Warning</strong><p class="simpara">此函数可能返回布尔值
- <strong><code>FALSE</code></strong>,但也可能返回等同于 <strong><code>FALSE</code></strong> 的非布尔值,例如 <em>0</em> 或
- ""(空串)。请阅读 <a href="language.types.boolean.html" class="link">布尔类型</a>章节以获取更多信息。应使用 <a href="language.operators.comparison.html" class="link">===
- 运算符</a> 来测试此函数的返回值。</p></div>
- </div>
- <div class="refsect1 seealso" id="refsect1-function.iconv-strrpos-seealso">
- <h3 class="title">参见</h3>
- <p class="para">
- <ul class="simplelist">
- <li class="member"> <span class="function"><a href="function.strrpos.html" class="function" rel="rdfs-seeAlso">strrpos()</a> - 计算指定字符串在目标字符串中最后一次出现的位置</span></li>
- <li class="member"> <span class="function"><a href="function.iconv-strpos.html" class="function" rel="rdfs-seeAlso">iconv_strpos()</a> - Finds position of first occurrence of a needle within a haystack</span></li>
- <li class="member"> <span class="function"><a href="function.mb-strrpos.html" class="function" rel="rdfs-seeAlso">mb_strrpos()</a> - 查找字符串在一个字符串中最后出现的位置</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.iconv-strpos.html">iconv_strpos</a></div>
- <div class="next" style="text-align: right; float: right;"><a href="function.iconv-substr.html">iconv_substr</a></div>
- <div class="up"><a href="ref.iconv.html">iconv 函数</a></div>
- <div class="home"><a href="index.html">PHP Manual</a></div>
- </div></body></html>