previousValidate_FI::refNum (Previous) (Next) Validate_FRnext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Validate_FI::creditCard

Validate_FI::creditCard() – Validate credit card number

Synopsis

require_once 'Validate/FI.php';

bool Validate_FI::creditCard ( string $number )

Description

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.

Parameter

string $number

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

Return value

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

Example

Using creditCard()

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

$creditCard '5427 0073 1297 6425';
if ( 
Validate_FI::creditCard($creditCard) ) {
    print 
'Valid';
} else {
    print 
'Not valid!';
}
?>
previousValidate_FI::refNum (Previous) (Next) Validate_FRnext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.