Re: FN-FORUM: PHP form validation Q
date posted 6th January 2005 16:31
You could use:
$var=str_replace(" ","",$var);
Before doing the is_numeric(), but regular expressions are so much
more flexible if you wanted to use them for the other fields etc.
Regards,
Joe.
On 6 Jan 2005 17:01:23 -0000, Luke Perman [EMAIL REMOVED] wrote:
> On 6 Jan 2005, at 16:34, Gareth Griffiths wrote:
> > I haven't tested this, but using is_numeric will probably bring up the
> > error message if someone includes a space in their phone number, i.e.
> > "01743 366336".
> >
> > I would suggest going down the regular expressions route that someone
> > has
> > already posted, as many people will not be expecting to have to remove
> > the
> > space from their phone number.
>
> oh, ok. i'll test properly.
>
> cheers for the tip.