RE: [PHP] sentence case
| From: | Chris W. Parker | Date: | Wed, 23 Feb 2005 18:49:32 +0000 |
| Subject: | RE: [PHP] sentence case | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-209278@lists.php.net to get a copy of this message | ||
Leif Gregory <mailto:Leifg@doh.state.nm.us>
on Wednesday, February 23, 2005 10:31 AM said:
> I'm thinking something like:
>
> 1. strtolower() the string
> 2. explode() on the period
> 3. Loop through the resulting array
> a. trim() whitespace on each element
> b. ucfirst() on each element of the array
> c. Concatenate the string back together, putting a period and a
> space at the end of each element.
And on top of that he'll need to convert all 'i' to 'I' because of step
1.
Chris.