function tableMaker($key) { $alphabetTemplate = "abcdefghiklmnopqrstuvwxyz"; $cleanKey = stripRepeats($key); $cipherTable = $cleanKey; for ($i = 0; $i < strlen($alphabetTemplate); $i++) { if (strpos($cipherTable, $alphabetTemplate[$i]) === false) { $cipherTable .= $alphabetTemplate[$i]; } } return trim($cipherTable); }
function getCipherString($key) { $alphabetTemplate = "abcdefghijklmnopqrstuvwxyz"; $cleanKey = stripRepeats($key); $cipherString = $cleanKey; for ($i = 0; $i < strlen($alphabetTemplate); $i++) { if (strpos($cipherString, $alphabetTemplate[$i]) === false) { $cipherString .= $alphabetTemplate[$i]; } } return trim($cipherString); }