This string is missing a digit.

\n"); echo("

Error Repair

\n"); echo("

Attempting error correction by single digit insertion.\n"); } elseif (strlen($clean) == 10) { echo("

This string has an error in at least one position.

\n"); echo("

Error Repair

\n"); echo("

Attempting error correction by single character " . "replacement or pairwise transposition.\n"); } else { echo("

This string has an extraneous character.

\n"); echo("

Error Repair

\n"); echo("

Attempting error correction by single character deletion.\n"); } echo("

\n"); $corrections = generate_ISBN_corrections($clean); foreach ($corrections as $newISBN => $dummy) { if (is_assigned($newISBN)) $correction_text .= '
  • ' . $newISBN . "
  • \n"; } if (strlen($correction_text) == 0) { echo("

    Sorry, no correction is possible.\n

    "); } else { echo("

    The following valid ISBNs have been generated.

    \n"); echo("\n"); } } function analyze_and_report($original, $clean) { echo("

    ISBN Analysis for $original

    \n"); echo("

    Checksum

    \n"); echo("

    The string is ISBN-checksum correct!

    \n"); $canon = canonical_ISBN($clean); $codes = split("-", $canon); if (sizeof($codes) == 4) { if ((strlen($original) > 10) && (str_replace("x", "X", $original) != $canon)) { echo("

    Hyphenation error: hyphenation ignored.

    \n"); } echo("

    Canonical Form

    \n"); if ($canon == $original) { echo("The ISBN as specified is already in USIN canonical form!\n"); } else { echo('The USIN canonical form for this ISBN is ' . $canon . ".\n"); } echo("

    ISBN Structure

    "); echo("
    \n"); echo("
    Country/Group Code: " . $codes[0] . "
    \n"); echo("
    " . country_group_name($clean) . "
    \n"); echo("
    Publisher Code: " . $codes[1] . "
    \n"); echo("
    Book Code: " . $codes[2] . "
    \n"); echo("
    Check Digit: " . $codes[3] . "
    \n"); echo("
    \n"); echo('

    Try the bibp link: bibp:ISBN/' . $canon . "!

    \n"); } else { echo("

    Unassigned

    \n"); echo("

    This ISBN is in an unassigned range!

    "); echo("
    \n"); echo("
    Country/Group Code: " . $codes[0] . "
    \n"); echo("
    " . country_group_name($clean) . "
    \n"); echo("
    Publisher/Book Code: " . $codes[1] . "
    \n"); echo("
    unassigned
    \n"); echo("
    Check Digit: " . $codes[2] . "
    \n"); echo("
    \n"); } } ?> Bookland EAN\n"); echo("

    This string appears to be an ISBN encoded as a Bookland EAN.\n"); $ISBN_proto = substr($ISBN_proto, 3, strlen($ISBN_proto) - 4); $ISBN_proto .= make_checkdigit(mod11_checksum($ISBN_proto, 10)); echo("Computing ISBN string for analysis: $ISBN_proto

    \n"); $clean = ISN_clean($ISBN_proto); $class = ISBN_classifier($clean); } if ($class == "checksumOK") analyze_and_report($ISBN_proto, $clean); else { echo("

    Error in ISBN

    \n"); echo("

    ISBN string under analysis: $clean

    \n"); if ($class == "single_error") error_repair_and_report($clean); else { echo("

    This string "); if ($class == "short") echo("is too short to be an ISBN.\n"); elseif ($class == "short/invalid") echo("is too short to be an ISBN and contains invalid characters.\n"); elseif ($class == "long") echo("is too long to be an ISBN.\n"); elseif ($class == "long/invalid") echo("is too long to be an ISBN and contains invalid characters.\n"); elseif ($class == "invalid") echo("contains two or more invalid ISBN characters.\n"); echo("There are too many errors for error correction to be attempted.

    \n"); } echo("

    An ISBN consists of 9 significant digits and a check digit.\n"); echo("The check digit may be 'X' or 'x' to represent a checksum of 10.\n"); echo("Optional embedded hyphens should reflect the internal structure consisting " . "of country/group code, publisher code, book code and check digit.\n"); echo("

    "); } } ?>

    ISBN Syntax Analyzer

    Enter an ISBN protostring for analysis.