function validateCreditCard($cc_number) {
// regex for credit card number
$regex = '/^[0-9]{13,16}$/';
// check if the credit card number matches the regex
if (preg_match($regex, $cc_number)) {
// return true if it matches
return true;
} else {
// return false if it doesn't match
return false;
}
}
//example
$result = validateCreditCard('1234567890123456');
//output
echo $result; //true
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)