Support Joomla!
Main
News
Help
Forum
Extensions
Shop
Developers
Joomla! 1.5 Documentation
Home
API reference wiki
Browse SVN repository
Packages
Select a package...
Unknown
Cache_Lite
com-tecnick-tcpdf
core
Joomla-Framework
OpenID
patError
patTemplate
PEAR
phpGACL
PHPMailer
PHP_Compat
utf8
Yadis
Package: utf8
Other documents
Changelog
To do
To do (2)
Element index (all)
Error log
Install
Copyright
License
Developer Network License
The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the
Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5
Source code for file /phputf8/substr_replace.php
Documentation is available at
substr_replace.php
<?php
/**
*
@version
$Id: substr_replace.php,v 1.1 2006/02/25 13:50:17 harryf Exp $
*
@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
]
)
;
}
Documentation generated on Mon, 05 Mar 2007 21:27:23 +0000 by
phpDocumentor 1.3.1