note 113494 added to function.ucwords

From: Date: Fri, 18 Oct 2013 20:46:07 +0000
Subject: note 113494 added to function.ucwords
Groups: php.notes 
Request: Send a blank email to php-notes+get-196586@lists.php.net to get a copy of this message
This function will work on anything, not just words separated by spaces. (eg: 'ac/bc/dc,xc zz' => 'Ac/Bc/Dc,Xc Zz') function ucwords_all($str) { return preg_replace_callback('/\b(\w)/', function($m) { return strtoupper($m[0]); }, $str); } ---- Server IP: 69.147.83.199 Probable Submitter: 41.46.21.154 ---- Manual Page -- http://php.net/manual/en/function.ucwords.php Edit -- https://master.php.net/note/edit/113494 Del: integrated -- https://master.php.net/note/delete/113494/integrated Del: useless -- https://master.php.net/note/delete/113494/useless Del: bad code -- https://master.php.net/note/delete/113494/bad+code Del: spam -- https://master.php.net/note/delete/113494/spam Del: non-english -- https://master.php.net/note/delete/113494/non-english Del: in docs -- https://master.php.net/note/delete/113494/in+docs Del: other reasons-- https://master.php.net/note/delete/113494 Reject -- https://master.php.net/note/reject/113494 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#196586) next »