Hi all...
I'm having probs with is_numeric...
here's the body of a function I've written...
the inout shoud be:
2 x letters
5 x numbers
eg: fr23454 / kr55555 / AP84754

Buuuut...
these are coming up as valid too?
F454354 / 4G64345 / L454345

it seems that if there's a single number in the usercode, it's accepting it...
can anyone see what I'm doing wrong? stupid tech :-(

=========================
$codeLength = strlen($usercode);
$getLast5Characters = substr($usercode, -5, 5);
$getFirst2Characters = substr($usercode, 0, 2);
$codeInt = is_numeric($getLast5Characters);
$codeAlpha = is_numeric($getFirst2Characters);
if (($codeLength == 7) && ($codeInt) && (!$codeAlpha)) {
        return "code valid";
} else {
        return "Code Invalid";
}
=========================


--
When a person can no longer laugh at himself, it is time for others to
laugh at him.
Thomas Szasz

____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
      Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to