> -----Original Message-----
> From: Robert Cummings [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 27, 2008 5:09 PM
> To: Keikonium
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Uppercase first letter of each new line?
> 
> 
> On Wed, 2008-02-27 at 16:38 -0500, Keikonium wrote:
> > Thank you again Robert, and thank you too Daniel. I have gotten both
> methods
> > to work flawlessly so far :). I am slowly learning by trial and error
> here,
> > but sometimes a little push in the right direction does some good ^_^.
> 
> Nothing against Dan, but you should use my version if this is coming
> from browser submitted data. Dan's presumes unix lines endings which
> won't always be the case.
> 
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for       |
> | creating re-usable components quickly and easily.          |
> `------------------------------------------------------------'
> 
> --

Unless you only get line feeds ("\r"), this should work as well (for "\n" or
"\r\n" as line separators) 

$text = getTextFromSomewhereElse();
$newText = join("\n", array_map('ucfirst', explode("\n", $text)));

(fist thing that came to my mind, just posting because of that... use the regex
if you want to be safe)

Regards,

Rob(inet)


Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 |
TEL 954-607-4207 | FAX 954-337-2695 | 
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE: bestplace |
 Web: bestplace.biz  | Web: seo-diy.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to