I put singlespaced text in a textarea and submit it (using PHP) to a MySQL database. But when I view it, it shows it double spaced, like on this page: http://www.vbshelf.com/snippets/inde...cat=forms&id=1
How can I fix it?
Printable View
I put singlespaced text in a textarea and submit it (using PHP) to a MySQL database. But when I view it, it shows it double spaced, like on this page: http://www.vbshelf.com/snippets/inde...cat=forms&id=1
How can I fix it?
When you echo the code, either surround it with <pre></pre>, or replace all newlines (\n or \r) with both newlines and linebreaks (<br>).