note 83531 added to function.nl2br
| From: | Jurik at osu1 dot php dot net | Date: | Fri, 30 May 2008 14:58:06 +0000 |
| Subject: | note 83531 added to function.nl2br | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140003@lists.php.net to get a copy of this message | ||
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 :)
----
Server IP: 217.13.201.10
Probable Submitter: 217.9.101.82
----
Manual Page -- http://www.php.net/manual/en/function.nl2br.php
Edit -- https://master.php.net/note/edit/83531
Del: integrated -- https://master.php.net/note/delete/83531/integrated
Del: useless -- https://master.php.net/note/delete/83531/useless
Del: bad code -- https://master.php.net/note/delete/83531/bad+code
Del: spam -- https://master.php.net/note/delete/83531/spam
Del: non-english -- https://master.php.net/note/delete/83531/non-english
Del: in docs -- https://master.php.net/note/delete/83531/in+docs
Del: other reasons-- https://master.php.net/note/delete/83531
Reject -- https://master.php.net/note/reject/83531
Search -- https://master.php.net/manage/user-notes.php