note 16962 added to function.ucfirst

From: Date: Tue, 20 Nov 2001 13:44:49 +0000
Subject: note 16962 added to function.ucfirst
Groups: php.notes 
Request: Send a blank email to php-notes+get-21061@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 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 http://master.php.net/manage/user-notes.php?action=edit+16962 http://master.php.net/manage/user-notes.php?action=delete+16962 http://master.php.net/manage/user-notes.php?action=reject+16962

« previous php.notes (#21061) next »