PHP 8.5.0 Alpha 4 available for testing

Voting

: min(two, three)?
(Example: nine)

The Note You're Voting On

faxe at neostrada dot pl
19 years ago
A simple mb_str_ireplace() implementation - a faster (?) replacement for non-regexp multi-byte string replacement:

<?php
function mb_str_ireplace($co, $naCo, $wCzym)
{
$wCzymM = mb_strtolower($wCzym);
$coM = mb_strtolower($co);
$offset = 0;

while(!
is_bool($poz = mb_strpos($wCzymM, $coM, $offset)))
{
$offset = $poz + mb_strlen($naCo);
$wCzym = mb_substr($wCzym, 0, $poz). $naCo .mb_substr($wCzym, $poz+mb_strlen($co));
$wCzymM = mb_strtolower($wCzym);
}

return
$wCzym;
}
?>

[thiago - EDITOR NOTE: This function has improvements from d-okumura [aat] fi{dot}kyd[dot]co.jp]

<< Back to user notes page

To Top