EAN

EAN Class

This class provides EAN validation and checksumming functionality.

category

VuFind

package

Code

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Main Page

Methods

Given the first 12 digits of an EAN, generate the check digit.

getEAN13CheckDigit(string $ean) : string
static

Arguments

$ean

string

The first 12 digits of an EAN.

Response

string

The check digit.

Is the provided EAN valid?

isValidEAN13(string $ean) : boolean
static

Arguments

$ean

string

The EAN to test.

Response

boolean

Return the first sequence of at least 12 digits followed by an optional X.

normalizeEAN(string $raw) : string
static

These characters may be separated by any number of '.', '-', '_' and whitespace characters; the separation characters are removed. A lower x is converted to an upper X.

Arguments

$raw

string

EAN to clean up.

Response

string

Normalized EAN.