Re: text to HTML

From: Date: Sun, 26 Aug 2007 21:59:04 +0000
Subject: Re: text to HTML
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-261306@lists.php.net to get a copy of this message
On Sun, August 26, 2007 9:36 am, Ron Piggott wrote: > > Is there a PHP command that turns text into HTML? > > EXAMPLE: > > "before" > > Hi. > > How are you doing? > > "after" > > Hi.<p> > > How are you doing?<p> http://php.net/nl2br You could also do: echo "<p>", str_replace("\n", "</p>\n</p>", $text), "</p>\n"; Another option, if the text is more pre-formatted or ASCII-art like, is to wrap it in <pre></pre> tags -- or style it with CSS as, errr, whatever, instead of <pre> tags. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#261306) next »