RE: [PHP] Similar functions?
| From: | Jake McHenry | Date: | Thu, 20 Nov 2003 06:57:34 +0000 |
| Subject: | RE: [PHP] Similar functions? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-170392@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: RT [mailto:rthomp@sympatico.ca]
> Sent: Thursday, November 20, 2003 1:40 AM
> To: Jake McHenry
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Similar functions?
>
>
> I'm not sure if this is what you're looking for but if it is
> it will be much easier the regex's
>
> http://ca.php.net/manual/en/ref.ctype.php
>
> The functions here look to see if variables are alpha,
> numeric, or alpha/numeric and some other stuff.
>
> On Thu, 2003-11-20 at 01:24, Jake McHenry wrote:
> > Can anyone tell me if there are similar functions in php as
> javascript
> > isNaN, or do I just have to do a
> >
> > if (preg_match('/([A-Z][a-z][`~!@#$%^&*()_=+|\?/><,.;:{}-])/',
> > $_POST['Personal_Hotel_CC_Number']) == 0){}
> >
> >
> > I know the above doesn't work, would there be an easier way
> for me to
> > find if any of the chars are not numbers?
> >
> > I could do:
> >
> > if (preg_match_all("/([0-9])/", $var, $match) == 16){}
> >
> > But AMEX cards are only 15 digits...
> >
> > It's for credit card verification.
> >
> >
> > Thanks,
> >
> > Jake McHenry
> > Nittany Travel MIS Coordinator
> > http://www.nittanytravel.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> --
> "I have a photographic memory. I just forgot the film"
> --Unknown ============================= Ryan Thompson
> rthomp@sympatico.ca http://osgw.sourceforge.net
>
>
This is even better... I can remove almost all of my regex's and
replace with these...
Thanks again!
Thanks,
Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.com