CoreFiles by mySites.guru
substr_replace.php24 lines, 656 bytes, from Joomla_1.6.6-Stable-Full_Package.zip
Raw History Compare with 1.6.5
md5
a0a082776b47b988e4e55adb02052370
sha1
30e49261426bd5abfc1e3dfcd45e0c3a376c5d63
sha256
bb2e3969dc5b9483b0c8cb366695d300c124cd5a78dfb8f81cc41736f51c77f0
<?php
/**
* @version $Id: substr_replace.php 16235 2010-04-20 04:13:25Z pasamio $
* @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 7 releases, Joomla 1.6.0 to 1.6.6. See them all, or every version of this file.