Location: PHPKode > scripts > CodeBreak - Hidden Morse Code > codebreak-hidden-morse-code/encode_database.inc.php
<?php
for ($cn = 0; $cn < strlen($input_text); $cn++) {
    switch (substr($input_text, $cn, 1)) {  // process one character at a time
    case "A":
        encode_morse(".-", $cn);
        break;
    case "B":
        encode_morse("-...", $cn);
        break;
    case "C":
        encode_morse("-.-.", $cn);
        break;
    case "D":
        encode_morse("-..", $cn);
        break;
    case "E":
        encode_morse(".", $cn);
        break;
    case "F":
        encode_morse("..-.", $cn);
        break;
    case "G":
        encode_morse("--.", $cn);
        break;
    case "H":
        encode_morse("....", $cn);
        break;
    case "I":
        encode_morse("..", $cn);
        break;
    case "J":
        encode_morse(".---", $cn);
        break;
    case "K":
        encode_morse("-.-", $cn);
        break;
    case "L":
        encode_morse(".-..", $cn);
        break;
    case "M":
        encode_morse("--", $cn);
        break;
    case "N":
        encode_morse("-.", $cn);
        break;
    case "O":
        encode_morse("---", $cn);
        break;
    case "P":
        encode_morse(".--.", $cn);
        break;
    case "Q":
        encode_morse("--.-", $cn);
        break;
    case "R":
        encode_morse(".-.", $cn);
        break;
    case "S":
        encode_morse("...", $cn);
        break;
    case "T":
        encode_morse("-", $cn);
        break;
    case "U":
        encode_morse("..-", $cn);
        break;
    case "V":
        encode_morse("...-", $cn);
        break;
    case "W":
        encode_morse(".--", $cn);
        break;
    case "X":
        encode_morse("-..-", $cn);
        break;
    case "Y":
        encode_morse("-.--", $cn);
        break;
    case "Z":
        encode_morse("--..", $cn);
        break;
    case "0":
        encode_morse("-----", $cn);
        break;
    case "1":
        encode_morse(".----", $cn);
        break;
    case "2":
        encode_morse("..---", $cn);
        break;
    case "3":
        encode_morse("...--", $cn);
        break;
    case "4":
        encode_morse("....-", $cn);
        break;
    case "5":
        encode_morse(".....", $cn);
        break;
    case "6":
        encode_morse("-....", $cn);
        break;
    case "7":
        encode_morse("--...", $cn);
        break;
    case "8":
        encode_morse("---..", $cn);
        break;
    case "9":
        encode_morse("----.", $cn);
        break;
    case ".":
        encode_morse(".-.-.-", $cn);
        break;
    case ",":
        encode_morse("--..--", $cn);
        break;
    case ":":
        encode_morse("---...", $cn);
        break;
    case "?":
        encode_morse("..--..", $cn);
        break;
    case "'":
        encode_morse(".----.", $cn);
        break;
    case "-":
        encode_morse("-....-", $cn);
        break;
    }
}
$output_text = "<form>\n" . $output_text . "<br>\n<input type=\"submit\" name=\"action\" value=\"Select\">\n</form>\n";
?>
Return current item: CodeBreak - Hidden Morse Code