PageRenderTime 43ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/php/function.iconv-strrpos.html

https://bitbucket.org/thncr/manuals
HTML | 131 lines | 105 code | 26 blank | 0 comment | 0 complexity | 01f6fd755d61e20bf1fb56028eb64a66 MD5 | raw file
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  5. <title>Finds the last occurrence of a needle within a haystack</title>
  6. </head>
  7. <body><div class="manualnavbar" style="text-align: center;">
  8. <div class="prev" style="text-align: left; float: left;"><a href="function.iconv-strpos.html">iconv_strpos</a></div>
  9. <div class="next" style="text-align: right; float: right;"><a href="function.iconv-substr.html">iconv_substr</a></div>
  10. <div class="up"><a href="ref.iconv.html">iconv 函数</a></div>
  11. <div class="home"><a href="index.html">PHP Manual</a></div>
  12. </div><hr /><div id="function.iconv-strrpos" class="refentry">
  13. <div class="refnamediv">
  14. <h1 class="refname">iconv_strrpos</h1>
  15. <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>
  16. </div>
  17. <div class="refsect1 description" id="refsect1-function.iconv-strrpos-description">
  18. <h3 class="title">说明</h3>
  19. <div class="methodsynopsis dc-description">
  20. <span class="type">int</span> <span class="methodname"><strong>iconv_strrpos</strong></span>
  21. ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$haystack</code></span>
  22. , <span class="methodparam"><span class="type">string</span> <code class="parameter">$needle</code></span>
  23. [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$charset</code><span class="initializer"> = ini_get(&quot;iconv.internal_encoding&quot;)</span></span>
  24. ] )</div>
  25. <p class="para rdfs-comment">
  26. Finds the last occurrence of a <em><code class="parameter">needle</code></em>
  27. within a <em><code class="parameter">haystack</code></em>.
  28. </p>
  29. <p class="para">
  30. In contrast to <span class="function"><a href="function.strrpos.html" class="function">strrpos()</a></span>, the return value of
  31. <span class="function"><strong>iconv_strrpos()</strong></span> is the number of characters that
  32. appear before the needle, rather than the offset in bytes to the
  33. position where the needle has been found. The characters are counted
  34. on the basis of the specified character set <em><code class="parameter">charset</code></em>.
  35. </p>
  36. </div>
  37. <div class="refsect1 parameters" id="refsect1-function.iconv-strrpos-parameters">
  38. <h3 class="title">参数</h3>
  39. <p class="para">
  40. <dl>
  41. <dt>
  42. <span class="term"><em><code class="parameter">haystack</code></em></span>
  43. <dd>
  44. <p class="para">
  45. The entire string.
  46. </p>
  47. </dd>
  48. </dt>
  49. <dt>
  50. <span class="term"><em><code class="parameter">needle</code></em></span>
  51. <dd>
  52. <p class="para">
  53. The searched substring.
  54. </p>
  55. </dd>
  56. </dt>
  57. <dt>
  58. <span class="term"><em><code class="parameter">charset</code></em></span>
  59. <dd>
  60. <p class="para">
  61. If <em><code class="parameter">charset</code></em> parameter is omitted,
  62. <em><code class="parameter">string</code></em> are assumed to be encoded in
  63. <a href="iconv.configuration.html" class="link">iconv.internal_encoding</a>.
  64. </p>
  65. </dd>
  66. </dt>
  67. </dl>
  68. </p>
  69. <p class="para">
  70. If <em><code class="parameter">haystack</code></em> or <em><code class="parameter">needle</code></em> is
  71. not a string, it is converted to a string and applied as the ordinal
  72. value of a character.
  73. </p>
  74. </div>
  75. <div class="refsect1 returnvalues" id="refsect1-function.iconv-strrpos-returnvalues">
  76. <h3 class="title">返回值</h3>
  77. <p class="para">
  78. Returns the numeric position of the last occurrence of
  79. <em><code class="parameter">needle</code></em> in <em><code class="parameter">haystack</code></em>.
  80. </p>
  81. <p class="para">
  82. If <em><code class="parameter">needle</code></em> is not found,
  83. <span class="function"><strong>iconv_strrpos()</strong></span> will return <strong><code>FALSE</code></strong>.
  84. </p>
  85. <div class="warning"><strong class="warning">Warning</strong><p class="simpara">此函数可能返回布尔值
  86. <strong><code>FALSE</code></strong>但也可能返回等同于 <strong><code>FALSE</code></strong> 的非布尔值例如 <em>0</em>
  87. &quot;&quot;(空串)请阅读 <a href="language.types.boolean.html" class="link">布尔类型</a>章节以获取更多信息应使用 <a href="language.operators.comparison.html" class="link">===
  88. 运算符</a> 来测试此函数的返回值</p></div>
  89. </div>
  90. <div class="refsect1 seealso" id="refsect1-function.iconv-strrpos-seealso">
  91. <h3 class="title">参见</h3>
  92. <p class="para">
  93. <ul class="simplelist">
  94. <li class="member"> <span class="function"><a href="function.strrpos.html" class="function" rel="rdfs-seeAlso">strrpos()</a> - 计算指定字符串在目标字符串中最后一次出现的位置</span></li>
  95. <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>
  96. <li class="member"> <span class="function"><a href="function.mb-strrpos.html" class="function" rel="rdfs-seeAlso">mb_strrpos()</a> - 查找字符串在一个字符串中最后出现的位置</span></li>
  97. </ul>
  98. </p>
  99. </div>
  100. </div><hr /><div class="manualnavbar" style="text-align: center;">
  101. <div class="prev" style="text-align: left; float: left;"><a href="function.iconv-strpos.html">iconv_strpos</a></div>
  102. <div class="next" style="text-align: right; float: right;"><a href="function.iconv-substr.html">iconv_substr</a></div>
  103. <div class="up"><a href="ref.iconv.html">iconv 函数</a></div>
  104. <div class="home"><a href="index.html">PHP Manual</a></div>
  105. </div></body></html>