dagon;10913274 wrote:it is a php issue, you can use str_replace to replace your line breaks
$text='<p>'.str_replace("\n\n",'</p><p>',$text).'</p>';
Ok this has left me baffled. I'm not sure how to use your code to see how it works. 😕
how would you use your example on this sql query:
<?PHP
$query = "SELECT headerText FROM text WHERE '".$content."' = page";
$result = @($query);
$text='<p>'.str_replace("\n\n",'</p><p>',$text).'</p>';
echo "<h1>My PHP practice and learning page</h1>
while ($row = mysql_fetch_array($result)){
echo "$row[headerText]";
}
?>
The contents of the headerText row is typed into a db row like this:
This is the first paragraph of my practice page.
And this is the second paragrpah of my practice page.
There is no html formatting tags of any kind, just an 2 enter key presses that separates the lines.
Thanks