note 83531 deleted from function.nl2br by felipe
| From: | felipe@php.net | Date: | Fri, 30 May 2008 18:37:31 +0000 |
| Subject: | note 83531 deleted from function.nl2br by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140011@lists.php.net to get a copy of this message | ||
Note Submitter: Jurik
----
I hope this saves you a bit of your time.
I was using ln2br with php 5.2.5 and was wondering, why my firefox only shows a <br>.
Althought I used XHTML in doctype.
I tested it with following code:
<?php
$test = "foo\nbar";
echo str_replace('<br>',' - ',nl2br($test));
?>
Result was (html code):
foo<br>
bar
When I replaced the '<br>' with '<br />' the result was (html code):
foo -
bar
So do not be fooled by firefox :)