API16

JString/substr replace

From Joomla! Documentation

< API16:JString
Revision as of 17:48, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== UTF-8 aware substr_replace Replace text within a portion of a string <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JString/substr...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

[Edit Descripton]

Template:Description:JString/substr replace

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);
        }
}

[Edit See Also] Template:SeeAlso:JString/substr replace

Examples[edit]

<CodeExamplesForm />