public function ISBNtest::valid_gtin14 in Biblio Advanced Import 6
Same name and namespace in other branches
- 7 lib/isbntest.class.php \ISBNtest::valid_gtin14()
1 call to ISBNtest::valid_gtin14()
File
- lib/
isbntest.class.php, line 235
Class
Code
public function valid_gtin14($isbn = "") {
if ($isbn != "") {
// if we've been given an ISBN here, use it
$this
->set_gtin14($isbn);
}
if (FALSE === $this->gtin14 || strlen($this->gtin14) != 14) {
$this->error = "GTIN-14 is not set";
return FALSE;
}
if (substr($this->gtin14, 13, 1) === $this
->get_gtin14_checkdigit()) {
return TRUE;
}
else {
$this->error = "Checkdigit failure";
return FALSE;
}
}