note 47569 deleted from function.str-replace by bjori
| From: | bjori@php.net | Date: | Sun, 26 Mar 2006 22:26:26 +0000 |
| Subject: | note 47569 deleted from function.str-replace by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106679@lists.php.net to get a copy of this message | ||
Note Submitter:
----
---[ Editor's Note ]---
This way works, but it's easier to just use nl2br() instead, which supports both \n and \r,
whereas this function does not support both.
---[ End Note ]---
This is an easy way to replace the breaks and paragrafs submitted via a Textarea to <br>s in
the output.
<?Php
$test="Teststring
test test
test test test test";
echo str_replace(Chr(13), "<br>", $test);
?>