PDA

View Full Version : PHP help



sdasevne
11-11-2007, 08:52 PM
In my formmail script, there's a statement like
$Sendto = "name1@domain.com, name2@domain.com";

To prevent spammers, I'd like to change this to something like this:

$Sendto = "name1$domain?com, name2$domain?com";
replace ($Sendto,"$","@");
replace ($Sendto,"?",".");

But, not knowing PHP, I don't know if there is a "replace" statement that can replace one character with another. Can someone let me know if there is such a function available?

sjlplat
11-12-2007, 12:55 AM
Try the str_replace() function.

sdasevne
11-12-2007, 03:26 AM
Thanks. str_replace works fine.