PHP library to validate and convert ISBNs and EANs

Overview

biblys/isbn

tests Latest Stable Version Total Downloads License Gitpod ready-to-code

biblys/isbn can be used to:

  • validate a string against the ISBN-10, ISBN-13 and EAN-13 formats
  • convert an ISBN to ISBN-10, ISBN-13, EAN-13 and GTIN-14 formats
  • parse an ISBN and extract registration agency, publisher code, publication code, checksum, etc.

CHANGELOG

Installation

Install with composer:

composer require biblys/isbn:^2.3.0

Usage

Formatting

Use case: converting an EAN (9782843449499) to an ISBN-13 (978-2-84344-949-9).

<?php

use Biblys\Isbn\Isbn;

try {
    $input = "9782843449499";
    $isbn13 = Isbn::convertToIsbn13($input);
    echo "ISBN-13: $isbn13"; // Prints ISBN-13: 978-2-84344-949-9
} catch(Exception $e) {
    echo "An error occured while attempting to format ISBN $input: ".$e->getMessage();
}

All formating methods:

  • Isbn::convertToIsbn10
  • Isbn::convertToIsbn13
  • Isbn::convertToEan13
  • Isbn::convertToGtin14

Validating

Use case: validating an incorrectly formed ISBN-13 (978-2-843-44949-9, should be 978-2-84344-949-9).

<?php

use Biblys\Isbn\Isbn;

try {
    $input = "978-2-843-44949-9";
    Isbn::validateAsIsbn13($input);
    echo "ISBN $input is valid!";
} catch(Exception $e) { // Will throw because third hyphen is misplaced
    echo "ISBN $input is invalid: ".$e->getMessage();
}

All validating methods:

  • Isbn::validateAsIsbn10
  • Isbn::validateAsIbsn13
  • Isbn::validateAsEan13
  • Isbn::isParsable

Learn more about validating ISBNs

Development

Using Gitpod

You can start a dev environnement by clicking Gitpod ready-to-code and start hacking in your browser right away!

Locally

If you'd rather setup a local dev environnement, you'll need:

  • PHP 7.x
  • Composer
  • (Optional) Docker to run tests and debug against different version of PHP

Clone this repository and run composer install to get started!

Tests

Run tests with PHPUnit:

composer install
composer test

Run tests in a docker container:

composer docker:test

Run tests in a docker container using a specific PHP version:

PHP_VERSION=7.1 composer docker:test

ISBN ranges update

New ISBN ranges may be added from time to time by the International ISBN Agency. Whenever it happens, this library must be updated. If a range update is necessary, please open an issue on Github. You can also open a pull request after updating the ranges your self with the following commands:

composer install
composer run update-ranges

Or using a docker container:

composer docker:update-ranges

Changelog

See Github releases

Comments
  • ISBNs with invalid product code or country code are considered valid

    ISBNs with invalid product code or country code are considered valid

    Hi, with some EAN's i receive notices, for example:

    • 6540260328208
    • 6897896354577
    • 6245954654327

    I am missing something or it's a bug?

    How to reproduce:

    #script.php
    $isbn = new Biblys\Isbn\Isbn("6897896354577");
    $isbn13 = $isbn->format('EAN');
    

    This is are the errors

    PHP Notice - Undefined offset: 3, /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php, 291
    #0 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(291): {closure}(8, 'Undefined offse...', '/xxx/...', 291, Array)
    #1 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(104): Biblys\Isbn\Isbn->calculateChecksum('EAN')
    #2 /xxx/script.php(16): Biblys\Isbn\Isbn->format('EAN')
    #3 {main}
    PHP Notice - Undefined offset: 5, /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php, 291
    #0 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(291): {closure}(8, 'Undefined offse...', '/xxx/...', 291, Array)
    #1 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(104): Biblys\Isbn\Isbn->calculateChecksum('EAN')
    #2 /xxx/script.php(16): Biblys\Isbn\Isbn->format('EAN')
    #3 {main}
    PHP Notice - Undefined offset: 7, /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php, 291
    #0 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(291): {closure}(8, 'Undefined offse...', '/xxx/...', 291, Array)
    #1 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(104): Biblys\Isbn\Isbn->calculateChecksum('EAN')
    #2 /xxx/script.php(16): Biblys\Isbn\Isbn->format('EAN')
    #3 {main}
    PHP Notice - Undefined offset: 9, /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php, 291
    #0 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(291): {closure}(8, 'Undefined offse...', '/xxx/...', 291, Array)
    #1 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(104): Biblys\Isbn\Isbn->calculateChecksum('EAN')
    #2 /xxx/script.php(16): Biblys\Isbn\Isbn->format('EAN')
    #3 {main}
    PHP Notice - Undefined offset: 11, /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php, 291
    #0 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(291): {closure}(8, 'Undefined offse...', '/xxx/...', 291, Array)
    #1 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(104): Biblys\Isbn\Isbn->calculateChecksum('EAN')
    #2 /xxx/script.php(16): Biblys\Isbn\Isbn->format('EAN')
    #3 {main}
    PHP Notice - Undefined offset: 4, /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php, 291
    #0 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(291): {closure}(8, 'Undefined offse...', '/xxx/...', 291, Array)
    #1 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(104): Biblys\Isbn\Isbn->calculateChecksum('EAN')
    #2 /xxx/script.php(16): Biblys\Isbn\Isbn->format('EAN')
    #3 {main}
    PHP Notice - Undefined offset: 6, /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php, 291
    #0 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(291): {closure}(8, 'Undefined offse...', '/xxx/...', 291, Array)
    #1 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(104): Biblys\Isbn\Isbn->calculateChecksum('EAN')
    #2 /xxx/script.php(16): Biblys\Isbn\Isbn->format('EAN')
    #3 {main}
    PHP Notice - Undefined offset: 8, /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php, 291
    #0 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(291): {closure}(8, 'Undefined offse...', '/xxx/...', 291, Array)
    #1 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(104): Biblys\Isbn\Isbn->calculateChecksum('EAN')
    #2 /xxx/script.php(16): Biblys\Isbn\Isbn->format('EAN')
    #3 {main}
    PHP Notice - Undefined offset: 10, /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php, 291
    #0 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(291): {closure}(8, 'Undefined offse...', '/xxx/...', 291, Array)
    #1 /xxx/composer/vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php(104): Biblys\Isbn\Isbn->calculateChecksum('EAN')
    #2 /xxx/script.php(16): Biblys\Isbn\Isbn->format('EAN')
    #3 {main}
    
    
    bug 
    opened by nu111 12
  • Add support for GTIN-14 encoding

    Add support for GTIN-14 encoding

    I use this excellent class for virtually all things ISBN-related (working for a publisher, that’s quite a lot), but there’s one area where it falls short: when shipping titles, many recipients require packing labels to include a barcode of the ISBN encoded as GTIN-14 (GS1-128).

    The conversion itself is simple enough: any valid EAN can be represented as GTIN-14 by adding a single-digit prefix (most commonly 1, but any digit is valid) and recalculating the checksum. Checksum calculation for GTIN-14 also follows the same principles as for EAN (alternately multiplying digits by 3 and 1 right-to-left and getting the modulo of the sum).

    In other words it should in theory be perfectly easy and straightforward to add GTIN capabilities to the class. In fact, since the underlying identifier doesn’t change, only the prefix and the checksum, it should be possible – as far as I can tell – to do this by doing nothing more than modifying the format and calculateChecksum functions and adding a property _prefix.

    Would this be useful to anyone but me, or would it be felt to be outside the scope of the class? If it’s not felt to be out of scope, I’d make a pull request for merging.

    enhancement 
    opened by kokoshneta 6
  • Bug in the 978-613 range

    Bug in the 978-613 range

    Hi,

    great library! I encountered a PHP warning while trying to apply it to convert this EAN to ISBN-13: 9786130971311

    The problem is that in the 978-613 there is missing an "array ()" around the 'Range' key/value array. Are you generating this Ranges manually or automatically from some database?

    bug 
    opened by baschny 6
  • Improve error output

    Improve error output

    Hey there, I want to use your library, but one thing I stumbled upon was error message management: Is there an easy way to get just the actual error message (eg, ISBN too short)?

    I guess it would be helpful to convert those to Exceptions, too. I want to replace some custom code I hacked together with your library, but don't know exactly how my error management could be committed to your project.

    Cheers, S1SYPHOS

    enhancement 
    opened by S1SYPHOS 5
  • Validating invalid ISBN 9786303025575 throws a PHP notice instead of an Exception

    Validating invalid ISBN 9786303025575 throws a PHP notice instead of an Exception

    An error occurred while attempting to format ISBN 9786303025575: Notice: Trying to access array offset on value of type null

    You can check it here: https://www.isbn-check.de/checkisbn.pl?isbn=9786303025575&submit=testen&lang=de

    bug 
    opened by StefanGlaesser 4
  • Invalid ISBN is returned as valid

    Invalid ISBN is returned as valid

    I've found an invalid ISBN number that will be returned as valid. The ISBN in question is: 34995031X

    If you format this ISBN to an EAN the functions throws a warning, but gives out an EAN: 97834995031X8

    The thrown warning is this:

    PHP Warning: A non-numeric value encountered in vendor/biblys/isbn/src/Biblys/Isbn/Isbn.php on line 318

    I guess the issue is this line

    https://github.com/biblys/isbn/blob/8214df245921c9c89545e8a1e35b268fdd37f869/src/Biblys/Isbn/Isbn.php#L162

    which returns "false" for this case. I sadly don't have a clue how to fix that one, but I'm hoping to delivery all information needed.

    bug 
    opened by KhorneHoly 4
  • newbie help

    newbie help

    Hi

    Having some issues. Which version of PHP does this require?

    It seems to install okay:

    $ composer require biblys/isbn:~2.0 ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 1 install, 0 updates, 0 removals

    • Installing biblys/isbn (2.0.7): Downloading (100%)
      Writing lock file Generating autoload files

    but does not like "use" statement:

    PHP Parse error: syntax error, unexpected 'use' (T_USE) in /home/parsebook.php on line 444

    Tried various workarounds without success. Did I miss a step somewhere? Don't really use composer much.

    thanks.

    opened by iandoug 4
  • Bump guzzlehttp/guzzle from 6.5.2 to 6.5.8

    Bump guzzlehttp/guzzle from 6.5.2 to 6.5.8

    Bumps guzzlehttp/guzzle from 6.5.2 to 6.5.8.

    Release notes

    Sourced from guzzlehttp/guzzle's releases.

    Release 6.5.8

    See change log for changes.

    Release 6.5.7

    See change log for changes.

    Release 6.5.6

    See change log for changes.

    6.5.5

    No release notes provided.

    6.5.4

    No release notes provided.

    6.5.3

    No release notes provided.

    Changelog

    Sourced from guzzlehttp/guzzle's changelog.

    6.5.8 - 2022-06-20

    • Fix change in port should be considered a change in origin
    • Fix CURLOPT_HTTPAUTH option not cleared on change of origin

    6.5.7 - 2022-06-09

    • Fix failure to strip Authorization header on HTTP downgrade
    • Fix failure to strip the Cookie header on change in host or HTTP downgrade

    6.5.6 - 2022-05-25

    • Fix cross-domain cookie leakage

    6.5.5 - 2020-06-16

    • Unpin version constraint for symfony/polyfill-intl-idn #2678

    6.5.4 - 2020-05-25

    • Fix various intl icu issues #2626

    6.5.3 - 2020-04-18

    • Use Symfony intl-idn polyfill #2550
    • Remove use of internal functions #2548
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 3
  • Problem updating ranges

    Problem updating ranges

    // Update: The ISBN page currently is unavailable due to maintenance:

    image

    In case the XML format / syntax changes, I'll notify you again - sorry for bothering!

    // Original message

    Hey there, it seems that with PHP v7.4 (in my case 7.4.11) the update script throws a great many errors:

    ❯ composer run update-ranges
    > php bin/update-ranges.php
    Requesting range information...
    Getting XML from https://www.isbn-international.org/?q=download_range//...
    PHP Notice:  Trying to get property 'result' of non-object in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 30
    PHP Notice:  Trying to get property 'value' of non-object in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 30
    PHP Notice:  Trying to get property 'result' of non-object in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 31
    PHP Notice:  Trying to get property 'filename' of non-object in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 31
    Converting to PHP array...
    PHP Warning:  simplexml_load_string(): Entity: line 48: parser error : Opening and ending tag mismatch: meta line 4 and head in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string(): </head> in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string():        ^ in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string(): Entity: line 61: parser error : Opening and ending tag mismatch: img line 4 and a in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string():                 </a> in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string():                     ^ in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string(): Entity: line 62: parser error : Opening and ending tag mismatch: a line 4 and div in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string():             </div> in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string():                   ^ in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string(): Entity: line 89: parser error : Opening and ending tag mismatch: div line 4 and body in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string(): </body></html> in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string():        ^ in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string(): Entity: line 89: parser error : Opening and ending tag mismatch: body line 4 and html in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string(): </body></html> in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string():               ^ in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string(): Entity: line 90: parser error : EndTag: '</' not found in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string():  in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Warning:  simplexml_load_string(): ^ in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 39
    PHP Notice:  Undefined index: EAN.UCCPrefixes in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 43
    PHP Notice:  Trying to access array offset on value of type null in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 43
    PHP Notice:  Undefined index: RegistrationGroups in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 44
    PHP Notice:  Trying to access array offset on value of type null in /path/to/project/vendor/biblys/isbn/bin/update-ranges.php on line 44
    Saving to /path/to/project/vendor/biblys/isbn/bin/../src/Biblys/Isbn/ranges-array.php...
    

    This results in an empty ranges-array.php file:

    <?php
    /*
     * This file is generated automatically by update-ranges.php, do not edit
     * manually! See README.md for more info. 
     *
     * This file is part of the biblys/isbn package.
     *
     * (c) Clément Bourgoin
     *
     * This package is Open Source Software. For the full copyright and license
     * information, please view the LICENSE file which was distributed with this
     * source code.
     */
    
    $groups = array (
    );
    $prefixes = array (
    );
    

    I'll have a look at this later, or maybe you beat me to it? :fox_face:

    Cheers, S1SYPHOS

    Composer v1.10.13 PHP v7.4.11

    opened by S1SYPHOS 3
  • Checksum calculation for ISBN-10 is wrong

    Checksum calculation for ISBN-10 is wrong

    Thanks for the great work.

    I found that the checksum calculation for ISBN-10 seems to be wrong. Line 285 should be $sum = (($c[0] * 1) + ($c[1] * 2) + ($c[2] * 3) + ($c[3] * 4) + ($c[4] * 5) + ($c[5] * 6) + ($c[6] * 7) + ($c[7] * 8) + ($c[8] * 9)) % 11;

    Best regards, Christian

    bug 
    opened by thinkmobilede 3
  • Refactor data arrays

    Refactor data arrays

    This PR refactors bin/update-ranges.php to do more work upfront so that the parsing code can be streamlined. It pre-process the XML file into a more compact and better parsable data structure. The new data structure uses associative arrays for prefix lookups and pre-splits the ranges.

    As an added bonus the new data structure is better suited for git-diffs (since the array keys are not part of the file anymore)

    The PR also includes a fix for the tests, since 9786303025575 is now a valid ISBN.

    opened by d--j 2
  • Add support for PHP 8

    Add support for PHP 8

    Hey there, since my upgrade to PHP 8 I get this when updating via composer:

    biblys/isbn 2.4.0 requires php ^7.1 -> your php version (8.0.8) does not satisfy that requirement.
    

    Please upgrade your composer.json accordingly, see #36

    Thanks!

    enhancement 
    opened by S1SYPHOS 9
Releases(3.0.0-alpha.3)
  • 3.0.0-alpha.3(Nov 27, 2022)

  • 2.6.0(Nov 27, 2022)

    This release adds an ISBN::parse public method that returns a ParsedIsbn object.

    It can be used to get parts of an ISBN code. As an example, the ISBN 9791091146456 could be split with the following methods :

    • ParsedIsbn->getGs1Element would return the EAN prefix "979"
    • ParsedIsbn->getRegistrationGroupElement would return the French language code "10"
    • ParsedIsbn->getRegistrantElement would return the "Dystopia" publisher code "91146"
    • ParsedIsbn->getPublicationElement would return the "Fournaise" publication code "45"
    • ParsedIsbn->getCheckDigit would return the checksum digit "979"

    Full Changelog: https://github.com/biblys/isbn/compare/2.5.0...2.6.0

    Source code(tar.gz)
    Source code(zip)
  • 3.0.0-alpha.2(Nov 25, 2022)

    Early release of version 3.0, supporting PHP 8, including release 2.5.1 from main branch.

    What's Changed

    • Bump guzzlehttp/psr7 from 1.6.1 to 1.8.5 by @dependabot in https://github.com/biblys/isbn/pull/52
    • Dependencies and range update by @clemlatz in https://github.com/biblys/isbn/pull/59

    Full Changelog: https://github.com/biblys/isbn/compare/2.5.0...3.0.0-alpha.2

    Source code(tar.gz)
    Source code(zip)
  • 2.5.1(Nov 25, 2022)

  • 3.0.0-alpha.1(Jun 26, 2022)

  • 2.5.0(Jan 10, 2022)

    This update adds support for the ISBN-A/DOI format. You can thank @rlueder for that! It introduces a new method to do so:

    Isbn::convertToIsbnA("9782207258040"); // returns "10.978.2207/258040"
    

    Also, trying to validate an ISBN with an unknown range will throw an IsbnParsingException instead of a cryptic PHP Notice about array offsets. Thanks to @StefanGlaesser for pointing that out.

    Isbn::convertToIsbn13("9786303025575"); // throws "Cannot find any ISBN range matching prefix 978-630"
    
    Source code(tar.gz)
    Source code(zip)
  • 2.4.0(Sep 27, 2021)

    The 2.4.0 update introduces a new method:

    Isbn::isParsable ( string $value ) : boolean
    

    This method returns true if the $value string can be parsed (and thus, converted into a valid ISBN-10, ISBN-13, EAN-13 or GTIN-14) and false if it cannot be.

    Learn more

    Source code(tar.gz)
    Source code(zip)
  • 2.3.0(Feb 28, 2021)

    This version introduces a new public API with seven new static methods:

    • Isbn::validateAsIsbn10
    • Isbn::validateAsIbsn13
    • Isbn::validateAsEan13
    • Isbn::convertToIsbn10
    • Isbn::convertToIsbn13
    • Isbn::convertToEan13
    • Isbn::convertToGtin14

    See README for details.

    This version sets as deprecated four legacy methods:

    • Isbn->isValid
    • Isbn->getErrors
    • Isbn->validate
    • Isbn->format

    These methods will trigger a deprecated notice when but will be supported until the next major (3.0) release. See Methods deprecated in 2.3.0 on how to upgrade your existing implementation.

    Source code(tar.gz)
    Source code(zip)
  • 2.2.0(Feb 23, 2021)

  • 2.1.5(Nov 17, 2020)

  • 2.1.4(Feb 28, 2020)

  • 2.1.3(Jan 9, 2020)

  • 2.1.2(Oct 13, 2019)

  • 2.1.1(Aug 17, 2019)

  • 2.1.0(Apr 18, 2019)

    • Added a validate method that throws an Exception on ISBN validation errors
    • Fixed #9: Improve error output
    • Added composer scripts to run tests and update ranges in a Docker container
    • Updated ISBN ranges
    Source code(tar.gz)
    Source code(zip)
  • 2.0.8(Feb 7, 2019)

    This library is now tested against PHP version 5.6, 7.0, 7.1 & 7.2

    • Fixed #7: ISBNs with invalid product code or country code are considered valid
    • Added PHP versions 7.1 & 7.2 to travis config file
    Source code(tar.gz)
    Source code(zip)
  • 2.0.7(Feb 1, 2019)

    • Attempts to format an invalid ISBN will now throw an Exception (fixes #7)
    • Fixed considering ISBNs with an invalid product code as valid (fixes #7)
    • Updated ISBN ranges
    Source code(tar.gz)
    Source code(zip)
  • 2.0.6(Nov 22, 2017)

  • 2.0.5(Nov 7, 2017)

  • 2.0.4(Jun 29, 2017)

  • 2.0.3(Jul 6, 2016)

  • 2.0.2(Apr 13, 2016)

  • 2.0.1(Apr 11, 2016)

  • 2.0.0(Mar 1, 2016)

  • 1.1(Aug 21, 2015)

Owner
Biblys
La solution web tout-en-un au service de la librairie et l'édition indépendante
Biblys
Validate and sanitize arrays and objects.

Aura.Filter This package provides tools to validate and sanitize objects and arrays. Foreword Installation This library requires PHP 5.4 or later; we

Aura for PHP 153 Jan 2, 2023
This package provides tools to validate and sanitize objects and arrays.

Aura.Filter This package provides tools to validate and sanitize objects and arrays. Foreword Installation This library requires PHP 7.2 or later; we

Aura for PHP 153 Jan 2, 2023
A simple package to validate against common passwords and help keep your application secure.

common-passwords A simple package to validate against common passwords and help keep your application secure. composer require crumbls/common-password

Crumbls 4 Oct 16, 2021
PHP library for ArCaptcha. This package supports PHP 7.3+.

PHP ArCaptcha Library PHP library for ArCaptcha. This package supports PHP 7.3+. List of contents PHP ArCaptcha Library List of contents Installation

Mohammad Abbasi 10 Aug 12, 2022
Lightweight and feature-rich PHP validation and filtering library. Support scene grouping, pre-filtering, array checking, custom validators, custom messages. 轻量且功能丰富的PHP验证、过滤库。支持场景分组,前置过滤,数组检查,自定义验证器,自定义消息。

PHP Validate 一个简洁小巧且功能完善的php验证、过滤库。 简单方便,支持添加自定义验证器 支持前置验证检查, 自定义如何判断非空 支持将规则按场景进行分组设置。或者部分验证 支持在进行验证前对值使用过滤器进行净化过滤内置过滤器 支持在进行验证前置处理和后置处理独立验证处理 支持自定义每

Inhere 246 Jan 5, 2023
PHP library - Validators for standards from ISO, International Finance, Public Administrations, GS1, Manufacturing Industry, Phone numbers & Zipcodes for many countries

IsoCodes PHP library - Validators for standards from ISO, International Finance, Public Administrations, GS1, Book Industry, Phone numbers & Zipcodes

Ronan Guilloux 767 Jan 2, 2023
A simple filtering library for PHP

Filterus - A flexible PHP 5.3 filter package Filter Methods: Each filter class has two primary methods: $filter->filter($var) - returns a modified ver

Anthony Ferrara 451 Dec 27, 2022
PHP Email address validator - A library for validating emails against several RFC.

EmailValidator A library for validating emails against several RFC. Supported RFCs This library aims to support RFCs: 5321, 5322, 6530, 6531, 6532, 10

Eduardo Gulias Davis 10.7k Jun 13, 2022
FyreValidation is a free, open-source validation library for PHP.

FyreValidation FyreValidation is a free, validation library for PHP. Table Of Contents Installation Validators Rules Error Messages Installation Using

Elusive 0 Jan 15, 2022
Light and extendable schema validation library

Light PHP validation library For everyone who uses MongoDB or other NoSQL solution and cares about what client sends to his/her database and looking f

Alexander Serkin 43 Sep 28, 2022
Valitron is a simple, elegant, stand-alone validation library with NO dependencies

Valitron: Easy Validation That Doesn't Suck Valitron is a simple, minimal and elegant stand-alone validation library with NO dependencies. Valitron us

Vance Lucas 1.5k Dec 30, 2022
[READ-ONLY] Validation library from CakePHP. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP Validation Library The validation library in CakePHP provides features to build validators that can validate arbitrary arrays of data with eas

CakePHP 39 Oct 11, 2022
Library that offers Input Filtering based on Annotations for use with Objects. Check out 2.dev for 2.0 pre-release.

DMS Filter Component This library provides a service that can be used to filter object values based on annotations Install Use composer to add DMS\Fil

Rafael Dohms 89 Nov 28, 2022
An extensible validation library for your data with sane defaults.

Hird Hirds, also known as housecarls, was a gathering of hirdmen, who functioned as the king's personal guards during the viking age and the early mid

Asko Nõmm 13 Apr 23, 2022
A re-write of rakit/validation, a standalone validation library inspired by Laravel Validation

Somnambulist Validation This is a re-write of rakit/validation, a standalone validator like Laravel Validation. In keeping with rakit/validation, this

Somnambulist Tech 18 Dec 14, 2022
Modern PHP validator on steroids for validating forms and/or array's.

Modern PHP Validator - Standalone Validation on Steroids Introduction Head first example Installation Adding fields for validation Execute validation

Kris Kuiper 5 Oct 5, 2022
php binding for IUP toolkit

php-iup php-ffi experiment php7.4 interface to the IUP toolkit for building GUI's. Description IUP-Toolkit IUP is a multi-platform toolkit for buildin

Shubham Chaudhary 20 Nov 13, 2022
A PHP package for validating/generating/formatting an IRS document number (CPF/CNPJ)

A PHP package for validating/generating/formatting an IRS document number (CPF/CNPJ)

null 7 Dec 15, 2022
File uploads with validation and storage strategies

Upload This component simplifies file validation and uploading. Usage Assume a file is uploaded with this HTML form: <form method="POST" enctype="mult

Brandon Savage 1.7k Dec 27, 2022