Рекурсивный акроним словосочетания «PHP: Hypertext Preprocessor»
Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17249 программистов и 1834 робота. Сейчас ищут 1675 программистов ...
Validate_FI::creditCard
Вернуться к: Validate_FI
Validate_FI::creditCard
Validate_FI::creditCard() – Validate credit card number
Synopsis
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.
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!';
}
?>
Вернуться к: Validate_FI