"Jason Giangrande" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I'm trying to replace newlines with something else.  For this example
> I'll use <br> as the thing to replace a newline with.  This is what I
> tried and it doesn't work.
>
> $article = str_replace("\n", "<br>", $article);
>
> What am I doing wrong?  $article is the string to replace the newlines
> in.  I tried this with a period and that works as expected.  Can I not
> replace newlines this way?

why not just:

$article = nl2br($article);

--
J. Cox
http://www.xaraya.com




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to