0

When I get data from a MySQL database and echo it using PHP viewing the HTML source show it like this

<div class="Desc">testing lines
new line
another                     </div>

How do I get it to add on the end of the lines so it shows correctly in the browser

I want to end up with something like this

<div class="Desc">testing lines<br/>
new line<br/>
another line<br/>                       </div>

I have tried <?PHP echo nl2br($text) ?> but that doesn't work

Grant
  • 2,413
  • 2
  • 30
  • 41

1 Answers1

0

yes you are correct - it does work, i was viewing the source or the wrong page after adding the nl2br code

my mistake

thanks anyway