A set of functions to check the validity of a credit card number. ccValidate
($number, $type) returns 1 if the account number is valid, zero if not. The
$type argument is optional. If included, it will perform additional checking to
ensure the card is of the type specified. Valid types include: visa,
mastercard, discover, and amex.
<?php
////////////////////////////////////////////////////
//
//
// Credit card validation routine //
// May 15,
1998 //
// By Brett
Error //
// brett@interwebdesign.com //
//
//
// validateCC($number[,$type]) //
// Uses the MOD 10 algorythm to determine if a //
// credit card number is valid. //
//
//
// $number = credit card account number //
// $type is optional. Setting type to //
// visa, mastercard, discover, or amex will //
// perform additional checking on the account //
//
number.
//
//
//
// The function returns 1 (true) if the CC is //
// valid, 0 (false) if it is invalid, and -1 if //
// the type entered does not match the supported //
// types listed
above. //
//
//
////////////////////////////////////////////////////