承接 violuke/php-barcodes 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

violuke/php-barcodes

最新稳定版本:v1.0.2

Composer 安装命令:

composer require violuke/php-barcodes

包简介

A collection of PHP classes for managing barcodes.

README 文档

README

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

Travis CI Packagist Packagist Packagist Packagist PHP 7 ready

https://packagist.org/packages/violuke/php-barcodes

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

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

统计信息

  • 总下载量: 559.36k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 39
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 39
  • Watchers: 5
  • Forks: 25
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2016-06-16