private function validateISBNChecksum($isbnNr)
    {
        $result = 0;
        $isbnNr = strtoupper($isbnNr);
        for ($i = 10; $i > 0; --$i) {
            if (is_numeric($isbnNr[$i - 1]) || ($i === 10 && $isbnNr[$i - 1] === 'X')) {
                if (($i === 1) && ($isbnNr[9] === 'X')) {
                    $result += 10 * $i;
                } else {
                    $result += $isbnNr[10 - $i] * $i;
                }
            } else {
                return false;
            }
        }

        return $result % 11 === 0;
    }
private function validateISBNChecksum($isbnNr)
    {
        $result = 0;
        $isbnNr = strtoupper($isbnNr);
        for ($i = 10; $i > 0; --$i) {
            if (is_numeric($isbnNr[$i - 1]) || ($i === 10 && $isbnNr[$i - 1] === 'X')) {
                if (($i === 1) && ($isbnNr[9] === 'X')) {
                    $result += 10 * $i;
                } else {
                    $result += $isbnNr[10 - $i] * $i;
                }
            } else {
                return false;
            }
        }

        return $result % 11 === 0;
    }
private function validateISBNChecksum ( $ isbnNr ) { $ result = 0 ; $ isbnNr = strtoupper ( $ isbnNr ) ; for ( $ i = 10 ; $ i > 0 ; -- $ i ) { if ( is_numeric ( $ isbnNr [ $ i - 1 ] ) || ( $ i === 10 && $ isbnNr [ $ i - 1 ] === 'X' ) ) { if ( ( $ i === 1 ) && ( $ isbnNr [ 9 ] === 'X' ) ) { $ result += 10 * $ i ; } else { $ result += $ isbnNr [ 10 - $ i ] * $ i ; } } else { return false ; } } return $ result % 11 === 0 ; }
Validates the ISBN number.
All characters should be numeric except the last digit that may be the character X,
which should be calculated as 10.

@param string $isbnNr A string containing the number without any dashes.

@return bool
Validates the ISBN number . All characters should be numeric except the last digit that may be the character X which should be calculated as 10 .