Replace line break with

This code is used to replace line break saved in database to
in html display

$astring = str_replace(chr(13) . chr(10), "", $astring);

Updated: Actually there is a built in function for this as follow

echo nl2br($astring);

Leave a Reply

Your email address will not be published. Required fields are marked *