note 83532 added to function.nl2br

From: Date: Fri, 30 May 2008 15:00:23 +0000
Subject: note 83532 added to function.nl2br
Groups: php.notes 
Request: Send a blank email to php-notes+get-140004@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 like me :) ---- 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/83532 Del: integrated -- https://master.php.net/note/delete/83532/integrated Del: useless -- https://master.php.net/note/delete/83532/useless Del: bad code -- https://master.php.net/note/delete/83532/bad+code Del: spam -- https://master.php.net/note/delete/83532/spam Del: non-english -- https://master.php.net/note/delete/83532/non-english Del: in docs -- https://master.php.net/note/delete/83532/in+docs Del: other reasons-- https://master.php.net/note/delete/83532 Reject -- https://master.php.net/note/reject/83532 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140004) next »