note 17964 added to function.str-replace
| From: | david at coolcomputing dot com | Date: | Sat, 05 Jan 2002 08:49:54 +0000 |
| Subject: | note 17964 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-24421@lists.php.net to get a copy of this message | ||
Let's say you have this:
foobar<tag>
<tag>
foobar
which you want to convert to this:
foobar
foobar
Doing a str_replace('<tag>', '', $string) will result in:
foobar
foobar
Not what you want.
Doing a str_replace("<tag>\r\n", '', $string) will result in:
foobarfoobar
Again not what you want.
Doing a str_replace("\r\n<tag>\r\n", "\r\n", $string) will do it:
foobar
foobar
--
http://www.php.net/manual/en/function.str-replace.php
http://master.php.net/manage/user-notes.php?action=edit+17964
http://master.php.net/manage/user-notes.php?action=delete+17964
http://master.php.net/manage/user-notes.php?action=reject+17964