|
Posted by Rik on 05/16/06 01:26
Juby wrote:
> preg_replace("/%email%/",$name,$mailbody);
>
> When that bit of code is run, the string "%email%" remains unchanged
> in $mailbody.
That's correct. You don't tell the function where to output the new string.
> I'm sure there's something wrong with my regular
> expression, but I just can't seem to figure out what it is.
Nope.
$mailbody = preg_replace("/%email%/",$name,$mailbody);
Sometimes you're looking in all the wrong places, forgetting the obvious
:-). (I have to confess that on my first try with regexes, I made the same
mistake. Took me almost over an hour pondering over the regex before I
realised it...)
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|