note 35106 deleted from function.strtoupper by cece

From: Date: Tue, 19 Aug 2003 21:57:59 +0000
Subject: note 35106 deleted from function.strtoupper by cece
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-54719@lists.php.net to get a copy of this message
Note Submitter: roodypoo@gmx.de ---- English: If you need to convert the first character of each word in a string into an uppercase-character, you might use this one i've typed. Deutsch: Wenn man eine Funktion benötigt, die innerhalb eines Strings den Anfangsbuchstaben jedes Wortes zum Grossbuchstaben macht, kann man meine kleine Funktion dafür verwenden. Input: "function written by peter piksa." Output: "Function Written By Peter Piksa." function first_uppercase($incoming) { $lenght = strlen($incoming); $outgoing = strtoupper($incoming[0]); for($i=1; $i<=$lenght; $i++) { if($incoming[$i] == " ") { $outgoing[$i] = " "; $outgoing[$i+1] = strtoupper($incoming[$i+1]); $i++; }else $outgoing[$i] = $incoming[$i]; } return($outgoing); }

« previous php.notes (#54719) next »