note 8214 modified in str_replace by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Fri, 08 Sep 2000 02:08:10 +0000 |
| Subject: | note 8214 modified in str_replace by jmcastagnetto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4471@lists.php.net to get a copy of this message | ||
[Editor's note: see trim(), and chop() instead of these workarounds]
johnf@aztech-cs.com asked:
Is there a way to remove all new lines from a string?
str_replace("\n","",$string); doesn't seem to do anything at all.
-------------------------------------
If you are replacing text say from a web form or something try adding this one:
str_replace("\r","",$string);
http://www.php.net/manual/function.str-replace.php