note 78130 deleted from function.nl2br by thiago
| From: | thiago@php.net | Date: | Wed, 29 Oct 2008 16:03:38 +0000 |
| Subject: | note 78130 deleted from function.nl2br by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-145935@lists.php.net to get a copy of this message | ||
Note Submitter: phpdoc at povaddict dot com dot ar
----
@flashyeu at yahoo dot com:
It's a newline. Browsers show newlines in the HTML code as spaces, unless in a <pre> tag.
Try this:
<?php
header("Content-Type: text/plain");
$str = 'One plus one is two
Two plus two is four.';
$str = nl2br($str);
$str = strip_tags($str);
print str_replace(' ','',$str);
//out put Oneplusoneistwo Twoplustwoisfour.
?>