/** * Check ISBN Code * * @param string $code ISBN Code to validate * @param array &$isbn Reference Array to fill with ISBN info * @return Returns TRUE if the ISBN validates, otherwise FALSE */ public static function checkIsbn($code, &$isbn) { return IsbnValidator\IsbnValidator::validate($code, $isbn); }
/** * Validate ISBN-13 Format * * Used internally by IsbnValidator::validate() which performs * string formatting before validating. * * @param string $isbn ISBN number to be validated * @return Returns FALSE if the ISBN is not a valid number, otherwise * returns the array set of number parts. */ private static function validateIsbn13($isbn) { $check = IsbnValidator::getCheckDigit($isbn, 13); $remainder = $check % 10; if ($remainder === 0) { return self::getIsbnParts($isbn); } else { return false; } }