[thelist] simple PHP problem

Rob Keniger rob at bigbang.net.au
Thu Oct 5 13:35:08 CDT 2000


on 10/5/00 8:31 AM, George at chaos_creates at yahoo.com wrote:

> To clarify: If i was to call two paragraphs of text
> from the same field in my Mysql table, that were
> seperated by a double space, would it possible with
> PHP, to dynamicaly add <P> tags to the begining of
> each paragraph so that when the brower reads it the
> text retains it's orginal formating instead of being
> outputed to the browser as one long piece of text.

You could try this, which inserts <br> tags:

nl2br

(PHP3 , PHP4 )
nl2br -- Converts newlines to HTML line breaks

Description

string nl2br (string string)


Returns string with '<BR>' inserted before all newlines.

<http://www.php.net/manual/html/function.nl2br.html>

HTH

-- 

Rob Keniger

big bang solutions

<mailto:rob at bigbang.net.au>
<http://www.bigbang.net.au>






More information about the thelist mailing list