JString/substr replace
From Joomla! Documentation
< API16:JString
The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
UTF-8 aware substr_replace Replace text within a portion of a string
Syntax[edit]
static substr_replace($str, $repl, $start, $length=NULL)
Parameter Name | Default Value | Description |
---|---|---|
$str | the haystack | |
$repl | the replacement string | |
$start | start | |
$length | NULL | length (optional) |
Defined in[edit]
libraries/joomla/utilities/string.php
Importing[edit]
jimport( 'joomla.utilities.string' );
Source Body[edit]
public static function substr_replace($str, $repl, $start, $length = NULL)
{
// loaded by library loader
if ( $length === FALSE ) {
return utf8_substr_replace($str, $repl, $start);
} else {
return utf8_substr_replace($str, $repl, $start, $length);
}
}
Examples[edit]
Code Examples[edit]