2017 © Pedro Peláez
 

library gtinvalidation

Validates GTIN product codes.

image

tiendanube/gtinvalidation

Validates GTIN product codes.

  • Thursday, July 26, 2018
  • by lombo
  • Repository
  • 5 Watchers
  • 0 Stars
  • 168 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

GtinValidation

Build Status License, (*1)

GtinValidation is a library for validating the format and check digit of a GTIN., (*2)

Requirements

  • PHP 5.4 or higher

Installation

You can find GtinValidation on Packagist. To install GtinValidation in Composer:, (*3)

{
  "require": {
    "tiendanube/gtinvalidation": "dev-master"
  }
}

Usage

Basic check

To check a GTIN's validity:, (*4)

<?php

use GtinValidation\GtinValidator;

$gtinValidator = new GtinValidator('0000000000000');
echo $gtinValidator->isValid();

Output, (*5)

false

Advanced Check

To get more detailed information about the GTIN and its validity, retrieve the GTIN object:, (*6)

<?php

use GtinValidation\GtinValidator;

$gtinValidator = new GtinValidator('0000000000000');
$gtinObject = $gtinValidator->getGtinObject();

echo $gtinObject->getType() . PHP_EOL;
echo $gtinObject->isValidFormat() . PHP_EOL;
echo $gtinObject->isValid() . PHP_EOL;

Output, (*7)

GTIN-13
true
false

The Versions

26/07 2018

dev-master

9999999-dev

Validates GTIN product codes.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

gtin product codes

26/07 2018

v1.0

1.0.0.0

Validates GTIN product codes.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

gtin product codes