note 46722 deleted from function.str-replace by tularis
| From: | tularis@php.net | Date: | Thu, 21 Oct 2004 11:28:21 +0000 |
| Subject: | note 46722 deleted from function.str-replace by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78876@lists.php.net to get a copy of this message | ||
Note Submitter: keith at webital dot de
----
After banging my head against a wall trying to strip line breaks from text coming from mysql using
the following
$remark = str_replace('<br>', ' ', trim($remark));
$remark = str_replace('\r', '', str_replace('\n', '',
$remark));
I discovered that it just does not work, no matter how I wrote it.
I then found the following which DOES strip out the line breaks
$remark = eregi_replace("\n"," ",eregi_replace("\r","
",strip_tags(trim(nl2br($remark)))));
- this is on a windows box.