RE: [PHP] ucwords Except 'The' 'And' etc?
| From: | Boget, Chris | Date: | Mon, 13 Aug 2001 16:07:07 +0000 |
| Subject: | RE: [PHP] ucwords Except 'The' 'And' etc? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-62459@lists.php.net to get a copy of this message | ||
> Is there a prewritten function for capitalizing the first
> letter of each word in a string except for the common
> words you wouldn't want to capitalize in a title? Like
> Come Learn the Facts From an Industry Leader
None that I've seen.
But it wouldn't be hard to write a function that takes a
string, passes that string to ucwords() and then you can
run through a pre-defined array and just do an ereg_replace()
on those words you want to remain lowercase...
Or something like that...
Chris