CoreFiles by mySites.guru
substr_replace.php24 lines, 651 bytes, from Joomla_1.5.3-Stable-Full_Package.zip
Raw History Compare with 1.5.2
md5
3c15cdeee7a7d455c3bdee38aad3b60d
sha1
3b794a9b551299bae718c2010b9e27b7358ad17a
sha256
eb4b23e2de0e372b046042fdb548224c1cf1c4f630938c7bb665740ca6a21ef9
<?php
/**
* @version $Id: substr_replace.php 7692 2007-06-08 20:41:29Z tcp $
* @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 4 releases, Joomla 1.5.0 to 1.5.3. See them all, or every version of this file.