note 57818 deleted from function.str-replace by mazzanet
| From: | mazzanet@php.net | Date: | Sat, 15 Oct 2005 08:58:36 +0000 |
| Subject: | note 57818 deleted from function.str-replace by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-97058@lists.php.net to get a copy of this message | ||
Note Submitter: dwight at wwwalker dot com dot au
----
There is problems trying to replace the < and > characters in an email address (copied from
email header) so that it is displayed in HTML OK.
Code:
$formatted = str_replace("<", "<", $myrow[desc]);
$formatted = str_replace(">", "%gt;", $myrow[desc]);
Input:
<email@fred.com.au>
produces corrupted output:
<email@fred.com.au>
which blocks out everything to the right of the <.
I can't find how to quote < or get it to work so just trimmed out all the < and > by
hand.