The other function I wrote to replace mb_strtolower may not work properly, as it erroneously equated graphemes with codepoints.
tolower, like many IntlChar methods, works specifically on codepoints, so requires a codepoint iterator to isolate each.
Also, because in tolower, if there is no lowercase version of the codepoint, the supplied one is returned, so there is no need to specially test for alphabetic codepoints before conversion.
<?php
function u_tolower($text=''){
if($text==''){return'';}
$iterator=IntlBreakIterator::createCodePointInstance();
$iterator->setText($text);
$newtext='';
foreach($iterator->getPartsIterator() as $codepoint){$newtext.=IntlChar::tolower($codepoint);}
return $newtext;
}
?>