CodeIgniter v4.5 API

CreditCardRules
in package

Class CreditCardRules

Provides validation methods for common credit-card inputs.

Tags
see
http://en.wikipedia.org/wiki/Credit_card_number
see
CreditCardRulesTest

Table of Contents

Properties

$nonStrictCreditCardRules  : CreditCardRules

Methods

__construct()  : mixed
valid_cc_number()  : bool
Verifies that a credit card number is valid and matches the known formats for a wide number of credit card types. This does not verify that the card is a valid card, only that the number is formatted correctly.

Properties

Methods

valid_cc_number()

Verifies that a credit card number is valid and matches the known formats for a wide number of credit card types. This does not verify that the card is a valid card, only that the number is formatted correctly.

public valid_cc_number(array<string|int, mixed>|bool|float|int|object|string|null $ccNumber, string $type) : bool

Example: $rules = [ 'cc_num' => 'valid_cc_number[visa]' ];

Parameters
$ccNumber : array<string|int, mixed>|bool|float|int|object|string|null
$type : string
Return values
bool

        
On this page

Search results