note 68707 added to function.ucwords

From: Date: Tue, 08 Aug 2006 12:11:20 +0000
Subject: note 68707 added to function.ucwords
Groups: php.notes 
Request: Send a blank email to php-notes+get-115646@lists.php.net to get a copy of this message
Before noticing this function I made the following function (that does the same as ucwords): <?php function firstUpper($string) { $string = str_replace(array("Æ","Ø","Å"), array("æ","ø","å"), strtolower($string)); $ord = explode(" ", $string); $return = ""; foreach ($ord as $val) { $return .= " " . str_replace(array("æ","ø","å"), array("Æ","Ø","Å"), strtoupper($val{0})) . substr($val,1,strlen($val)-1); } return $return; } ?> It also converts Danish letters without using the setlocale function. ---- Server IP: 194.239.128.50 Probable Submitter: 195.184.114.157 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.ucwords.php Edit -- https://master.php.net/note/edit/68707 Del: integrated -- https://master.php.net/note/delete/68707/integrated Del: useless -- https://master.php.net/note/delete/68707/useless Del: bad code -- https://master.php.net/note/delete/68707/bad+code Del: spam -- https://master.php.net/note/delete/68707/spam Del: non-english -- https://master.php.net/note/delete/68707/non-english Del: in docs -- https://master.php.net/note/delete/68707/in+docs Del: other reasons-- https://master.php.net/note/delete/68707 Reject -- https://master.php.net/note/reject/68707 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#115646) next »