how would I add Re: to the beginning of a string, only if a string doesnt already have an Re: on it?
I'm not very profficient with regular expressions, but here's my attempt.
if(!eregi("Re:", $string)) { $string = "Re: " . $string; }
$string = "Re: this is my string"; $first_three = substr($string,0,3);
if ($first_three != "Re:") { $string = "Re:".$string; }
This might work for you.