Validate_FI::creditCard() – Validate credit card number


require_once 'Validate/FI.php';

bool Validate_FI::creditCard ( string $number )


Validate credit card number.

This method checks the credit card number according to Luhn algorithm. This method doesn't guarantee that the card is legitimate.


string $number

credit card number to be validated (spaces and dashes tolerated)

Return value

boolean - true if credit card number is valid, false otherwise


Using creditCard()

// Include the package
require_once 'Validate/FI.php';

$creditCard '5427 0073 1297 6425';
if ( 
Validate_FI::creditCard($creditCard) ) {
} else {
'Not valid!';
Validate Finnish bank reference number (Previous) Validate_FR (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.