1.11M Members

Replace line breaks with <br />?

 
0
 

I have some text in a mysql table, stored as text and taken from an html <textarea>.

For example of some text.
Hi this
is Glens
webpage

When I display this on my web page it comes out as

Hi this is Gles webpage.

How do I get it to display with the newlines?

Here is the code.

while($info = mysql_fetch_array( $data )) { 
                          $date = $info["date"];
                          $date = strftime("%b %d, 20%y", strtotime($date));  

                          echo "<span class='span2'>";
                          echo "<p>";
                          echo $info['title'];
                          echo "......".$date;
                          echo $info['content'];
                          echo "</p>";
                          echo "</span>";
                          echo "<br />";

Thanks for looking.................

 
0
 

echo nl2br($info['content']);

 
0
 

Ahhhhhhhhhhhhh thats it!

Many thanks.................

Question Answered as of 1 Year Ago by urtrivedi
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article