class Ean

Utility class for validating EAN-8 and EAN-13 numbers

Constants

PATTERN

Methods

static int
checksum(string $digits)

Computes the checksum of an EAN number.

static bool
isValid(string $ean)

Checks whether the provided number is an EAN compliant number and that the checksum is correct.

Details

at line 22
static int checksum(string $digits)

Computes the checksum of an EAN number.

Parameters

string $digits

Return Value

int

See also

https://en.wikipedia.org/wiki/International_Article_Number

at line 46
static bool isValid(string $ean)

Checks whether the provided number is an EAN compliant number and that the checksum is correct.

Parameters

string $ean

An EAN number

Return Value

bool