CoreFiles by mySites.guru
substr_replace.php23 lines, 584 bytes, from Joomla_2.5.4-Stable-Full_Package.zip
Raw History Compare with 2.5.3
md5
315620f2dc6ce04d76a37b1cd77d4b95
sha1
b96104d3789e11f0c7bd601b10b43c1954687db7
sha256
969a83dc9d93a48317020bf1b9d30bcc1089a668500a437f0616bea481305ca1
<?php
/**
* @package utf8
* @subpackage strings
*/

//---------------------------------------------------------------
/**
* UTF-8 aware substr_replace.
* Note: requires utf8_substr to be loaded
* @see http://www.php.net/substr_replace
* @see utf8_strlen
* @see utf8_substr
*/
function utf8_substr_replace($str, $repl, $start , $length = NULL ) {
    preg_match_all('/./us', $str, $ar);
    preg_match_all('/./us', $repl, $rar);
    if( $length === NULL ) {
        $length = utf8_strlen($str);
    }
    array_splice( $ar[0], $start, $length, $rar[0] );
    return join('',$ar[0]);
}

The same content is in 5 releases, Joomla 2.5.0 to 2.5.4. See them all, or every version of this file.