Re: 'ucfirst' function for text area strings?
| From: | Jason Wong | Date: | Tue, 28 May 2002 17:42:57 +0000 |
| Subject: | Re: 'ucfirst' function for text area strings? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-99516@lists.php.net to get a copy of this message | ||
On Tuesday 28 May 2002 23:58, Andre Dubuc wrote:
> Is there a way to get a function similar to 'ucfirst' to work with the
> first letters of a set of strings in textarea strings?
>
> ******************************************************
> Inputted strings:
>
> "hi. i hope there is one. any ideas?"
>
> Should appear:
> "Hi. I hope there is one. Any ideas?"
>
> ******************************************************
>
> Would it be possible to do a 'foreach' 'ucfirst' type of statement while
> reading a string and breaking it apart at punctuation marks?
use explode() to break into sentences on whatever you deem to be a sentence
boundary (period, exclamation mark, question mark, whatever).
foreach() through the resulting array applying ucfirst(). Then join them all
up again.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Patriotism is the virtue of the vicious.
-- Oscar Wilde
*/