When I have a title for a page, I want it to only capitalize the words that are supposed to be capitalized in my language.
This recipe does just that. You assign the words you don't want upper cased, and this script does the rest. The list of lower cased words comprises common English words. For what its worth, the "rule" for lower casing is all articles (a, an, the), conjunctions (e.g. and, but), and prepositions of less than five letters (e.g. we lower case "from" but not "Until"). The list is not comprehensive.
- v1.1 - Updated for PHP5 (
preg_replace, etc.) Said Achmiz September 17, 2017, at 10:05 PM
- v1.0 - Originally written, based on an earlier discussion with others on the discusion list. I've used this for months now Dec 13, 2005 BenWilson
- BenWilson - Author