note 19756 added to function.str-replace
| From: | lordanthron at yahoo dot com | Date: | Sun, 10 Mar 2002 05:30:12 +0000 |
| Subject: | note 19756 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27569@lists.php.net to get a copy of this message | ||
i was using a flat-file db to record some info from a form, and the most common way to distinguish
between fields is |. i was looking for a way to keep the script from adding extra fields when
someone did explode ("|", $text), and here it is:
$text = str_replace("|", "|", $text);
hope it helps someone.
--
http://www.php.net/manual/en/function.str-replace.php
http://master.php.net/manage/user-notes.php?action=edit+19756
http://master.php.net/manage/user-notes.php?action=delete+19756
http://master.php.net/manage/user-notes.php?action=reject+19756