John W. Holmes wrote:

In $url, the periods still need to be escaped, too. This is where preg_quote() comes in handy.


$url = "http://www.foo.com/maxbid/Unsubscribe.php?EmailAddress=[MAIL]";;
$url = preg_quote($url);

$code = preg_replace("#$url#",$replace,$code,1);

I hope the OP took notice of the str_replace() remark, too. :)


Well, lookie here. I've been using php for 6 years now, and favor preg over ereg, but never knew about the preg_quote function. I'm a happy camper today.


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to