Two solutions for this:
-
PHP function
nl2br()
:e.g.,
echo nl2br("This\r\nis\n\ra\nstring\r"); // will output This<br /> is<br /> a<br /> string<br />
-
Wrap the input in
<pre></pre>
tags.
More Related Contents:
- Getting links from db and displaying them in another div [closed]
- HTML Form/PHP connected but MySQL is empty
- Php charset information [duplicate]
- Save the data into a database and return another value from database using PHP
- Math Symbol From Mysql To HTML? [closed]
- Thank you for helping [closed]
- Create hyperlink from html table row to open record on a new page
- Is the following code valid? [closed]
- How to insert images into a database using PHP [closed]
- How to upload images into MySQL database using PHP code
- Fetching data from MySQL database to HTML dropdown list
- HTML – Change\Update page contents without refreshing\reloading the page
- Delete multiple rows by selecting checkboxes using PHP
- “slash before every quote” problem [duplicate]
- mysql_fetch_array() expects parameter 1 to be resource problem [duplicate]
- How to add a delete button to a PHP form that will delete a row from a MySQL table
- mysqli_query() expects at least 2 parameters, 1 given in? [duplicate]
- display data from SQL database into php/ html table [closed]
- Echo menu tree with recursive function
- How to display an BLOB image stored in MySql database?
- Sending HTML Code Through JSON
- Javascript function post and call php script
- PHP – Secure member-only pages with a login system
- PHP: Inserting Values from the Form into MySQL
- onbeforeprint() and onafterprint() equivalent for non IE browsers
- Create table with PHP and populate from MySQL
- Turkish characters are not displayed correctly [duplicate]
- mysql_fetch_array skipping first row
- Displaying BLOB image from Mysql database into dynamic div in html
- MySQL PHP – SELECT WHERE id = array()? [duplicate]