note 75088 added to function.ucwords

From: Date: Fri, 11 May 2007 18:19:49 +0000
Subject: note 75088 added to function.ucwords
Groups: php.notes 
Request: Send a blank email to php-notes+get-126415@lists.php.net to get a copy of this message
Here's a simple routine I came up with to fix user data entry where people are too lazy to capitalize anything. I wanted to fix lowercase names without messing with those that might start with a lower case letter (like "de Angelo" as a last name). function FixCap ($value) { // if there's a capital letter in here somewhere, don't mess with this value. Otherwise, ucwords if( ereg("[A-Z]",$value) ) return $value; else return ucwords($value); } ---- Server IP: 64.71.164.2 Probable Submitter: 69.65.72.238 ---- Manual Page -- http://www.php.net/manual/en/function.ucwords.php Edit -- https://master.php.net/note/edit/75088 Del: integrated -- https://master.php.net/note/delete/75088/integrated Del: useless -- https://master.php.net/note/delete/75088/useless Del: bad code -- https://master.php.net/note/delete/75088/bad+code Del: spam -- https://master.php.net/note/delete/75088/spam Del: non-english -- https://master.php.net/note/delete/75088/non-english Del: in docs -- https://master.php.net/note/delete/75088/in+docs Del: other reasons-- https://master.php.net/note/delete/75088 Reject -- https://master.php.net/note/reject/75088 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#126415) next »