note 79861 added to function.ucwords

From: Date: Sun, 16 Dec 2007 11:09:42 +0000
Subject: note 79861 added to function.ucwords
Groups: php.notes 
Request: Send a blank email to php-notes+get-133645@lists.php.net to get a copy of this message
Function to do what ucwords is intended to do - just correctly also for international char sets: function mb_ucwords($s) { $s = mb_strtolower(trim($s)); $w = explode(" ", $s); $return = ""; foreach ($w as $val) { $return .= " " . mb_strtoupper($val{0}) . substr($val,1,strlen($val)-1); } return trim($return); } Building on an earlier snippet here. ---- Server IP: 195.184.96.15 Probable Submitter: 130.226.208.203 ---- Manual Page -- http://www.php.net/manual/en/function.ucwords.php Edit -- https://master.php.net/note/edit/79861 Del: integrated -- https://master.php.net/note/delete/79861/integrated Del: useless -- https://master.php.net/note/delete/79861/useless Del: bad code -- https://master.php.net/note/delete/79861/bad+code Del: spam -- https://master.php.net/note/delete/79861/spam Del: non-english -- https://master.php.net/note/delete/79861/non-english Del: in docs -- https://master.php.net/note/delete/79861/in+docs Del: other reasons-- https://master.php.net/note/delete/79861 Reject -- https://master.php.net/note/reject/79861 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#133645) next »