note 16962 modified in function.ucfirst by goba
| From: | goba@php.net | Date: | Sat, 24 Nov 2001 12:33:41 +0000 |
| Subject: | note 16962 modified in function.ucfirst by goba | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-21236@lists.php.net to get a copy of this message | ||
Note that if you are using this function to embellish the display of Dutch
or Spanish text, ucfirst will not recognise 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
--was--
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
http://www.php.net/manual/en/function.ucfirst.php