CoreFiles by mySites.guru
substr_replace.php24 lines, 656 bytes, from Joomla_1.5.4-Stable-Full_Package.zip
Raw History Compare with 1.5.3
md5
ff7b2bb563c558ff24e6b26d79013ee4
sha1
68a2aaf297348aa4fccda9dcb9933d3577a96eeb
sha256
7af55bf7073604e39bd198ae81647b2845e6150d81ef702847ab9b7e86a0468f
<?php
/**
* @version $Id: substr_replace.php 10381 2008-06-01 03:35:53Z 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 23 releases, Joomla 1.5.4 to 1.5.26. See them all, or every version of this file.