<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >mb_strrpos</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="Multibyte String Functions" HREF="ref.mbstring.html"><LINK REL="PREVIOUS" TITLE="mb_strripos" HREF="function.mb-strripos.html"><LINK REL="NEXT" TITLE="mb_strstr" HREF="function.mb-strstr.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP 手册</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.mb-strripos.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.mb-strstr.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.mb-strrpos" ></A >mb_strrpos</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN133801" ></A ><P > (PHP 4 >= 4.0.6, PHP 5)</P >mb_strrpos -- Find position of last occurrence of a string in a string </DIV ><DIV CLASS="refsect1" ><A NAME="AEN133804" ></A ><H2 >说明</H2 >int <B CLASS="methodname" >mb_strrpos</B > ( string haystack, string needle [, int offset [, string encoding]] )<BR ></BR ><P > <B CLASS="function" >mb_strrpos()</B > returns the numeric position of the last occurrence of <CODE CLASS="parameter" >needle</CODE > in the <CODE CLASS="parameter" >haystack</CODE > string. If <CODE CLASS="parameter" >needle</CODE > is not found, it returns <TT CLASS="constant" ><B >FALSE</B ></TT >. </P ><P > <B CLASS="function" >mb_strrpos()</B > performs multi-byte safe <A HREF="function.strrpos.html" ><B CLASS="function" >strrpos()</B ></A > operation based on number of characters. <CODE CLASS="parameter" >needle</CODE > position is counted from the beginning of <CODE CLASS="parameter" >haystack</CODE >. First character's position is 0. Second character position is 1. </P ><P > If <CODE CLASS="parameter" >encoding</CODE > is omitted, internal encoding is assumed. </P ><P > <CODE CLASS="parameter" >encoding</CODE > is character encoding. If it is not specified, internal character encoding is used. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > As of PHP 5.2.0 <CODE CLASS="parameter" >offset</CODE > may be specified to begin searching an arbitrary number of characters into the string. Negative values will stop searching at an arbitrary point prior to the end of the string. </P ></BLOCKQUOTE ></DIV ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > The <CODE CLASS="parameter" >encoding</CODE > parameter was moved from the third position to the fourth in PHP 5.2.0. For backward compatibility, <CODE CLASS="parameter" >encoding</CODE > can be specified as the third parameter, but doing so is deprecated and will be removed in the future. </P ></BLOCKQUOTE ></DIV ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN133843" ></A ><H2 >更新日志</H2 ><P > <DIV CLASS="informaltable" ><P ></P ><A NAME="AEN133846" ></A ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><THEAD ><TR ><TH >版本</TH ><TH >说明</TH ></TR ></THEAD ><TBODY ><TR ><TD >5.2.0</TD ><TD >Added the optional parameter <CODE CLASS="parameter" >offset</CODE >.</TD ></TR ></TBODY ></TABLE ><P ></P ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN133857" ></A ><H2 >参见</H2 ><P > <P ></P ><TABLE BORDER="0" ><TBODY ><TR ><TD ><A HREF="function.mb-strpos.html" ><B CLASS="function" >mb_strpos()</B ></A ></TD ></TR ><TR ><TD ><A HREF="function.mb-internal-encoding.html" ><B CLASS="function" >mb_internal_encoding()</B ></A ></TD ></TR ><TR ><TD ><A HREF="function.strrpos.html" ><B CLASS="function" >strrpos()</B ></A ></TD ></TR ></TBODY ></TABLE ><P ></P > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.mb-strripos.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >起始页</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.mb-strstr.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >mb_strripos</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.mbstring.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >mb_strstr</TD ></TR ></TABLE ></DIV ></BODY ></HTML >