|
Posted by Erwin Moller on 10/18/05 14:23
Jan Declercq wrote:
> Erwin Moller wrote:
>
>> Bjorn Skauge wrote:
>>
>>> Hi,
>>>
>>> I've just started to learn php and sql, and I noticed that there are
>>> several php discussion groups here. Pardon me if this is the wrong
>>> group, and I hope my first question isn't too silly. :-)
>>>
>>> I'm building a website that will publish articles, so I have an
>>> article table which contains a heading field, an ingress field, and a
>>> body field which will hold the complete article. There are line shifts
>>> (or page breaks) in this field, but my display-page won't show them.
>>> How do I show the article with the page breaks?
>>
>> Hi
>>
>> Add to the 'page breaks' a <br>
>>
>> so if you use \n as pagebreak, replace them
>> echo str_replace("\n","\n<br>",$yourContent);
>>
>> Regards,
>> Erwin Moller
>
> A better way would be: nl2br()
Just curious: Why is that better?
Regards,
Erwin Moller
> http://www.php.net/nl2br
Navigation:
[Reply to this message]
|