Re: Simple (??) control structure problem
| From: | Christopher Kaminski | Date: | Sun, 15 Jul 2001 20:18:22 +0000 |
| Subject: | Re: Simple (??) control structure problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-57980@lists.php.net to get a copy of this message | ||
Thanks alot! I didn't do that because I wasn't aware of the nl2br()
function.
I just taught myself php last weekend. There's still plenty for me to
learn.
"Yz James" <liljim@btconnect.com> wrote in message
news:20010715194530.98967.qmail@pb1.pair.com...
> Hi Christopher,
>
> Why not use nl2br() and trim() ?
>
> $string = trim($string); // Clear any unwanted white space (trailing and
> leading);
> $string = nl2br($string); // Add line breaks where necessary
>
> echo "$string"; // Voila
>
> James
>