List:General Discussion« Previous MessageNext Message »
From:Stefan Hinz Date:March 19 2003 5:36pm
Subject:Re: Text formatting of articles pulled from database??
View as plain text  
Landy,

> echo "<TD colspan=\"3\" width=\"532\"><P>$article</P></TD>";

> The text displays, but the paragraph breaks are gone and all the text 
> is just run together into one long paragraph.

In PHP, you can use nl2br(), like:

echo "<TD colspan=\"3\"
width=\"532\"><P>".nl2br($article)."</P></TD>";

This will replace "\n" (the new-line character that makes that line
break in TEXTAREA) by "<br/>". If you're a maniac (like I am) you can
even do:

echo "<TD colspan=\"3\" width=\"532\"><P>"
     .str_replace(nl2br($article),"<br/>","</p><p
     style=\text-indent:10px\">")
     ."</P></TD>";

Or something similar to that.

Regards,
--
  Stefan Hinz <hinz@stripped>
  iConnect GmbH <http://iConnect.de>
  Heesestr. 6, 12169 Berlin (Germany)
  Telefon: +49 30 7970948-0  Fax: +49 30 7970948-3

[filter fodder: sql, mysql, query]

Thread
Text formatting of articles pulled from database??Landy Atkinson19 Mar
  • Re: Text formatting of articles pulled from database??Henning Heil19 Mar
Re: Text formatting of articles pulled from database??Stefan Hinz19 Mar