Jump to content

Paragraph Breaks, Text Format In Echoed Mysql Table Text?


paulmo

Recommended Posts

You mean you want the newlines converted to breaks? nl2br().Or if you want paragraphs instead of double newlines? (Untested:)

$string = preg_replace("/((\r)?\n){2,}(.*?)((\r)?\n){2,}/s", "\n<p>$3</p>\n", $string);

Link to comment
Share on other sites

thanks for the responses. yes i'm in php, so str_replace or regex? thanks for that regex code. use <pre> in db table text or php code? or with regex, put code after echo $row? thanks for php manual link. i'll put together something and post it here.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...