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.................

Recommended Answers

All 2 Replies

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

Ahhhhhhhhhhhhh thats it!

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.