|
Posted by ZeldorBlat on 04/30/07 13:44
On Apr 29, 10:42 pm, "uncleclinto" <walterswebdes...@comcast.net>
wrote:
> Hey all,
>
> I'm a designer, not a developer, but I'm trying to learn. Anyway, I'm
> trying to get a contact form working, but apparently I have some empty
> expressions here. Of course, I don't know what the heck to put in them.
> Here's the lines in question. Any ideas other than "stick with design" and
> some choice explitives?
>
> $_POST['email'] = preg_replace("\r", "", $_POST['email']);
> $_POST['email'] = preg_replace("\n", "", $_POST['email']);
>
> Uncleclinto
Why does everyone use a regular expression for simple find/replace
operations like this? Much easier, and probably a bit faster:
str_replace(array("\n", "\r"), '', $_POST['email']);
[Back to original message]
|