Current Location: Home> Function Categories> strrpos

strrpos

Calculate the last occurrence of the specified string in the target string
Name:strrpos
Category:String
Programming Language:php
One-line Description:Finds where the string last appears in another string (case sensitive).

Example

Find the last occurrence of "php" in the string:

 <span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">echo</span> <span class="token function">strrpos</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"You love php, I love php too!"</span> <span class="token punctuation">,</span> <span class="token string double-quoted-string">"php"</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

Try it yourself

Similar Functions