User contributed note correction
| From: | Bert de Jong | Date: | Wed, 21 Nov 2001 08:12:30 +0000 |
| Subject: | User contributed note correction | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-7478@lists.php.net to get a copy of this message | ||
Dear sir, madam,
I posted the "user contributed note" below today for the function ucfirst.
I had tested the code but found out later I had accidentally sent old code
along with a tiny but fatal bug in it.. Here's the corrected one:
<NOTE>
Note that if you are using this function to embellish the display of Dutch
or Spanish text, ucfirst will not recognize your "ij"s (Dutch) or
"ll"s (Spanish), which in their respective languages need to be
capitalised both when they go on the beginning of a word.
Use
function ucfirst_beter($streng) {
return
$streng=(substr(strtolower($streng),0,2)=="ij")?(strtoupper(substr($streng,0,2)).substr($streng,2,(strlen($streng)-2))):(ucfirst($streng));
}
for Dutch text, or
function ucfirst_mejor($cuerda) {
return
$cuerda=(substr(strtolower($cuerda),0,2)=="ll")?(strtoupper(substr($cuerda,0,2)).substr($cuerda,2,(strlen($cuerda)-2))):(ucfirst($cuerda));
}
for Spanish text
cheers,
Bert a.k.a. Alberto
</NOTE>
Can you please update it?
regards,
Bert de Jong