Validate Credit Card


This Credit Card Number is invalid because it contains an empty string.

\n"; } else { $CreditCardNumber = $CardNumber; $CreditCardNumber = str_replace("-", "", $CreditCardNumber); $CreditCardNumber = str_replace(" ", "", $CreditCardNumber); if (!is_numeric($CreditCardNumber)) { echo "

Credit Card Number " . $CreditCardNumber . " is not a valid Credit Card Number because it contains a non-numeric character

\n"; } else { echo "

Credit Card Number " . $CreditCardNumber . " is a valid Credit Card Number.

\n"; } } } ?>