RE: [PHP] echo question
| From: | Jason Lotito | Date: | Sun, 20 May 2001 00:26:11 +0000 |
| Subject: | RE: [PHP] echo question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-53573@lists.php.net to get a copy of this message | ||
You are looking for the function nl2br()
Information here: http://www.newbienetwork.net/article.php?sid=70
And here: http://www.php.net/manual/en/function.nl2br.php
See echo statement below for example implementation.
Jason Lotito
www.NewbieNetwork.net
> -----Original Message-----
> From: Louis Brooks [mailto:louis@callook.org]
> Sent: Saturday, May 19, 2001 8:01 PM
> To: php-general@lists.php.net
> Subject: [PHP] echo question
>
>
> Hi All:
>
> I need to print out several paragraphs of information stored
> in a MySql
> field to a web page. To do this I am using:
>
> $db = mysql_connect("localhost", "dbase", "password");
> mysql_select_db("dbase",$db); $sql = "SELECT update FROM
> members WHERE username = 'Don'"; $query = mysql_query($sql);
> $results = mysql_fetch_array($query); $text = $results["update"];
>
echo nl2br($text);
>
> but it does not insert the returns between the paragraphs. I
> think I need
> to tell it to insert a <p> in place of the return. There is a
> way to do
> this as I have seen it on the PHP site when I was searching
> for something
> else. Of course now that I need it I can't find the example.
> Can someone
> please help me figure this out?
>
> Thank you,
>
> Louis Brooks
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-general-help@lists.php.net To contact the list
> administrators, e-mail: php-list-admin@lists.php.net
>
>