JString/strrpos: Difference between revisions
From Joomla! Documentation
m clean up |
m preparing for archive only |
||
| Line 4: | Line 4: | ||
===Syntax=== | ===Syntax=== | ||
| Line 45: | Line 45: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=strrpos | category=strrpos | ||
category=JString | category=JString | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
Latest revision as of 02:08, 25 March 2017
Description
UTF-8 aware alternative to strrpos Finds position of last occurrence of a string
Syntax
static strrpos($str, $search, $offset=false)
| Parameter Name | Default Value | Description |
|---|---|---|
| $str | - string String being examined | |
| $search | - string String being searced for | |
| $offset | false |
Returns
mixed Number of characters before the last match or FALSE on failure
Defined in
libraries/joomla/utilities/string.php
Importing
jimport( 'joomla.utilities.string' );
Source Body
public static function strrpos($str, $search, $offset = false)
{
return utf8_strrpos($str, $search);
}
Examples
Code Examples