26 or $rotBy < 1) { return "Number out of range"; } if ($rotBy == 26) { return $rotThis; } $rotThis = strtolower($rotThis); $rotThisArray = str_split($rotThis); for ($timesthrough = 0; $timesthrough <= each($rotThisArray);$timesthrough++) { $asciiValue = ord($rotThisArray[$timesthrough]); if (($asciiValue < 65) or (($asciiValue > 90) and ($asciiValue < 97)) or ($asciiValue > 122)) { continue; } else { $asciiValue = $asciiValue + $rotBy; if ($asciiValue > 122) { $wrapAdd = $asciiValue - 122; $asciiValue = 96 + $wrapAdd; } $rotThisArray[$timesthrough] = chr($asciiValue); } } $rotatedThis = implode($rotThisArray); return $rotatedThis; } function rot_tbl($string) { $i = 1; while ($i < 27) { echo $i.", ".rot($i, $string)."
"; $i = $i + 1; } } if ($_GET['string'] == false) { echo "Rot-X PHP Edition 1.5
String to encode/decode:

"; } else { echo "Rot-X PHP Edition 1.5
"; $string = $_GET['string']; echo rot_tbl($string); } ?>