Skip to main content
Inspiring
July 22, 2008
Question

line breaks

  • July 22, 2008
  • 1 reply
  • 214 views
Hi all

I'm a php newbie, though quite familiar with asp.

I'm trying to get the line breaks showing when the 'DescTxt' field data is
inserted on my page. I know (I think!) this is something to do with
'replace', but I don't know how to apply it to the following:

<p><?php echo $row_rsItemDetails['DescTxt']; ?></p>

I have searched and searched, but it's all Greek to me! If someone could
help me out and show me how the above code should look, I'd be much obliged.

many thanks

Chris


This topic has been closed for replies.

1 reply

Inspiring
July 22, 2008
On Tue, 22 Jul 2008 15:12:32 +0100, "Sweens" <info@121technology.com>
wrote:

>I'm trying to get the line breaks showing when the 'DescTxt' field data is
>inserted on my page. I know (I think!) this is something to do with
>'replace', but I don't know how to apply it to the following:
>
><p><?php echo $row_rsItemDetails['DescTxt']; ?></p>

<p><?php echo nl2br($row_rsItemDetails['DescTxt']); ?></p>

Gary