Re: new line function
| From: | Curt Zirzow | Date: | Thu, 02 Sep 2004 05:09:22 +0000 |
| Subject: | Re: new line function | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-195510@lists.php.net to get a copy of this message | ||
* Thus wrote John Holmes:
> Tonny Robertus wrote:
>
> >is there any function to replace \n to <br> that we can see the results in
> >html source code (not in preview)?
>
> $fixed = preg_replace("/(\r?\n)|\r/",'<br />',$oldstring);
again.. your the master of perfection :)
unix, dos, mac.. no matter, it still works!
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!