承接 rottingham/product-code-validation 相关项目开发

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

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

rottingham/product-code-validation

Composer 安装命令:

composer require rottingham/product-code-validation

包简介

Product UPC, EAN and ISBN Validator

README 文档

README

ProductValidator is a simply utility for Shopping cart software or custom projects to validate product codes.

Supports UPC-A, UPC-E 6, 7 and 8, EAN13 and ISBN10/ISBN13.

This software is free to use, distribute and change as you see fit according to the MIT Variant license.

Composer Ready

Available on Packagist: https://packagist.org/packages/rottingham/product-code-validation

Sample Usage

Simply import the ProductValidator.class.inc main class file if you are not utilizing auto loaders.

require '/ProductValidator.class.inc'; 

To use the validator, you can simply call its checkCode($code) method:

$result = ProductValidator\ProductValidator::checkCode('1560213639'); var_dump($result); 

checkCode attempts to smartly detect the codes type and returns and array containing the code type, (UPC, EAN, ISBN) the checkDigit for the code, and the isbn pieces if the code is an ISBN.

Individual Code Validation

To validate (TRUE|FALSE) a code you already know the type of, use ProductValidator's individual check functions:

var_dump(ProductValidator\ProductValidator::checkUpc('748196000441'); var_dump(ProductValidator\ProductValidator::checkEan('9781560213635'); var_dump(ProductValidator\ProductValidator::checkIsbn('1560213635'); 

checkUpc, checkEan and checkIsbn return TRUE if the check digit and code validates, or FALSE if they do not.

Validators

  • UpcValidator
  • EanValidator
  • IsbnValidator

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固