Here's a function I found on Zend's website, should be a good start for you.
Code:
Function ROT13($rot13text) {
$rot13text_rotated = "";
for ($i = 0; $i <= strlen($rot13text); $i++) {
$k = ord(substr($rot13text, $i, 1));
if ($k >= 97 and $k <= 109) {
$k = $k + 13;
} elseif ($k >= 110 and $k <= 122) {
$k = $k - 13;
} elseif ($k >= 65 and $k <= 77) {
$k = $k + 13;
} elseif ($k >= 78 and $k <= 90) {
$k = $k - 13;
}
$rot13text_rotated = $rot13text_rotated . Chr($k);
}
return $rot13text_rotated;
}
-the mole
|