ISBN

ISBN Class

This class provides ISBN validation and conversion functionality.

category

VuFind

package

Code

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Main Page

Methods

Constructor

__construct(string $raw) 

Arguments

$raw

string

Raw ISBN string to convert/validate.

Get the ISBN in ISBN-10 format:

get10() : mixed

Response

mixed

ISBN, or false if invalid/incompatible.

Get the ISBN in ISBN-13 format:

get13() : mixed

Response

mixed

ISBN, or false if invalid/incompatible.

Given the first 9 digits of an ISBN-10, generate the check digit.

getISBN10CheckDigit(string $isbn) : string
static

Arguments

$isbn

string

The first 9 digits of an ISBN-10.

Response

string

The check digit.

Given the first 12 digits of an ISBN-13, generate the check digit.

getISBN13CheckDigit(string $isbn) : string
static

Arguments

$isbn

string

The first 12 digits of an ISBN-13.

Response

string

The check digit.

Is the current ISBN valid in some format? (May be 10 or 13 digit).

isValid() : boolean

Response

boolean

Is the provided ISBN-10 valid?

isValidISBN10(string $isbn) : boolean
static

Arguments

$isbn

string

The ISBN-10 to test.

Response

boolean

Is the provided ISBN-13 valid?

isValidISBN13(string $isbn) : boolean
static

Arguments

$isbn

string

The ISBN-13 to test.

Response

boolean

Return the first sequence of at least 8 digits followed by an optional X.

normalizeISBN(string $raw) : string
static

These ISBN characters may be separated by any number of '.', '-', '_' and whitespace characters; the separation characters are removed. A lower x is converted to an upper X.

Arguments

$raw

string

ISBN to clean up.

Response

string

Normalized ISBN.

Properties

Raw ISBN string

raw : string
var

Type(s)

string

Validation status of ISBN (null until checked)

valid : boolean
var

Type(s)

boolean