2017 © Pedro Peláez
 

library php-barcodes

A collection of PHP classes for managing barcodes.

image

violuke/php-barcodes

A collection of PHP classes for managing barcodes.

  • Wednesday, August 16, 2017
  • by violuke
  • Repository
  • 5 Watchers
  • 18 Stars
  • 30,402 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 3 Versions
  • 15 % Grown

The README.md

PHP Barcode

A PHP class for checking EAN8, EAN13, UPC and GTIN barcodes are valid (based on check digit)., (*1)

Travis CI Packagist Packagist Packagist Packagist PHP 7 ready, (*2)

https://packagist.org/packages/violuke/php-barcodes, (*3)

Note: This project currently does nothing other than have some validation functions. I expect to add additional functionality in the future., (*4)

Installation (with composer)

composer require violuke/php-barcodes

Usage

// Class instantation
$barcode = '5060411950139';
$bc_validator = new \violuke\Barcodes\BarcodeValidator($barcode);


// Check barcode is in valid format
if ($bc_validator->isValid()) {
    echo 'Valid :)';
} else {
    echo 'Invalid :(';
}


// Get the barcode type
echo 'Barcode is in format of ' . $bc_validator->getType();
// Possible formats returned are:
// (string) "GTIN" which equals constant \violuke\Barcodes\BarcodeValidator::TYPE_GTIN
// (string) "EAN-8" which equals constant \violuke\Barcodes\BarcodeValidator::TYPE_EAN_8
// (string) "EAN" which equals constant \violuke\Barcodes\BarcodeValidator::TYPE_EAN
// (string) "EAN Restricted" which equals constant \violuke\Barcodes\BarcodeValidator::TYPE_EAN_RESTRICTED
// (string) "UPC" which equals constant \violuke\Barcodes\BarcodeValidator::TYPE_UPC
// (string) "UPC Coupon Code" which equals constant \violuke\Barcodes\BarcodeValidator::TYPE_UPC_COUPON_CODE


// Returns the barcode in GTIN-14 format
$bc_validator->getGTIN14()


// Returns the barcode as entered
$bc_validator->getBarcode()

TODO:

  • Barcode generation
  • GS1-128 barcode generation and interpretation

Credits

The Versions

16/08 2017

dev-master

9999999-dev

A collection of PHP classes for managing barcodes.

  Sources   Download

GPL-3.0+

The Requires

  • php ^5.0 || ^7.0

 

The Development Requires

20/06 2016

v1.0.1

1.0.1.0

A collection of PHP classes for managing barcodes.

  Sources   Download

GPL-3.0+

The Requires

  • php ^5.0 || ^7.0

 

16/06 2016

v1.0

1.0.0.0

A collection of PHP classes for managing barcodes.

  Sources   Download

The Requires

  • php ^5.0 || ^7.0