note 18922 deleted from function.ucwords by victor
| From: | victor@php.net | Date: | Sat, 12 Jun 2004 21:04:27 +0000 |
| Subject: | note 18922 deleted from function.ucwords by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-70985@lists.php.net to get a copy of this message | ||
Note Submitter: evan at coeus hyphen group dot com
----
The following blurb (should be all one line...) will capitalize all words except for "of",
"a", "the", and "and" (unless they are the first word, in which case
they will be capitalized.)
trim(ucfirst(str_replace(Array("Of ","A ","The ","And
"),Array("of ","a ","the ","and
"),ucwords(strtolower($str)))));
Unfortunately, it won't work w/ acronyms ("U.S.A." comes out "U.s.a."- but
that is a problem w/ ucwords.) There aren't any articles im missing, are there???