Voting

: max(six, four)?
(Example: nine)

The Note You're Voting On

devcoder at gmail dot com
6 years ago
My own generic rotN function

<?php
function rotN($string, $n = 13)
{
$alphabet = join(range('a', 'z'));
$alen = strlen($alphabet);

$n %= $alen;
if(
$n < 0) {
$n += $alen;
}
if(
$n == 0) {
return
$string;
}

$cycled = substr($alphabet . $alphabet, $n, $alen);
$alphabet = $alphabet . strtoupper($alphabet);
$cycled = $cycled . strtoupper($cycled);
return
strtr($string, $alphabet, $cycled);
}
?>

<< Back to user notes page

To Top