public static function substr_replace($str, $repl, $start, $length = null)
    {
        preg_match_all('/./us', $str, $ar);
        preg_match_all('/./us', $repl, $rar);
        if ($length === null) {
            $length = AnHelperString::strlen($str);
        }
        array_splice($ar[0], $start, $length, $rar[0]);
        return join('', $ar[0]);
    }
public static function substr_replace($str, $repl, $start, $length = null)
    {
        preg_match_all('/./us', $str, $ar);
        preg_match_all('/./us', $repl, $rar);
        if ($length === null) {
            $length = AnHelperString::strlen($str);
        }
        array_splice($ar[0], $start, $length, $rar[0]);
        return join('', $ar[0]);
    }
public static function substr_replace ( $ str , $ repl , $ start , $ length = null ) { preg_match_all ( '/./us' , $ str , $ ar ) ; preg_match_all ( '/./us' , $ repl , $ rar ) ; if ( $ length === null ) { $ length = AnHelperString :: strlen ( $ str ) ; } array_splice ( $ ar [ 0 ] , $ start , $ length , $ rar [ 0 ] ) ; return join ( '' , $ ar [ 0 ] ) ; }
UTF-8 aware substr_replace

Replace text within a portion of a string

@param string the haystack
@param string the replacement string
@param int start
@param int length (optional)
@see http://www.php.net/substr_replace
UTF - 8 aware substr_replace