How to Display Linebreaks from a MySQL Database with PHPAfter doing your MySQL query, you might have code such as the following to display the data on your web page: <?=$list['ReviewDesc']?> However, with the above code, any line breaks that your data contains will not be rendered on the page. You'll be able to see the linebreak symbols when looking at the data in MySQL Query Browser, but then no linebreaks are rendered when your data is displayed in the browser. The answer is to use the nl2br function, literally the newline to linebreak
function. This converts any linebreak symbol in your MySQL database to
<br /> in the browser: <?=nl2br($list['ReviewDesc'])?>
|
|
All Content ©2020 WebRef.eu |