PHP code example of tiendanube / gtinvalidation

1. Go to this page and download the library: Download tiendanube/gtinvalidation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tiendanube / gtinvalidation example snippets




use GtinValidation\GtinValidator;

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



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;