Re: Wrapping problems
| From: | Ray Black III | Date: | Tue, 06 Jun 2000 15:44:12 +0000 |
| Subject: | Re: Wrapping problems | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-225@lists.php.net to get a copy of this message | ||
By the text's "formatting" I guess you mean line breaks? I can't imagine
what else there is to format in straight text...
Anyway, easy solution to this:
echo nl2br($str);
http://www.php.net/manual/function.nl2br.php
-r3-
----- Original Message -----
From: Paul O' Connor <paul-oconnor@ardee.aibp.ie>
To: <php-db@lists.php.net>
Sent: Tuesday, June 06, 2000 11:33 AM
Subject: [PHP-DB] Wrapping problems
> Hi,
>
> I'm using PHP and MySQL to develop a knowledge base at work.
> I'm kind of new to PHP.
>
> I have a problem in that users are asked to enter in a full description to
> the knowledge base via a textarea on a form.
>
> This info is then stored in a field of type text.
>
> My problem is in displaying this text field. The text that will be entered
> will be formatted, e.g.
>
> 1. Step 1
> 2. Step 2
> 3. Step 3
>
> However, when I display the description (in a table) - the text looses
it's
> formatting giving
> 1. Step 1 2. Step 2 3. Step3.
>
> I've tried to use the <PRE> tag in the table generated by my PHP code but
> that results in the table growing as wide as the longest line of text
> instead of wrapping within the confines of the table.
>
> I've tried specifing a % width on my generated table but this doesn't work
> either.
>
> Any clues?
>
> Paul O' Connor.
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net