Pravdu díš, mrknul jsem se na funkci ord a ono to půjde i takto:
function caesar_cipher($text,$posunuti)
{
$text_new = '';
$text = strtolower($text);
for($i=0;$i<strlen($text);$i++)
{
$text_new .= (ord($text[$i])+$posunuti > 122) ? chr(ord($text[$i])+$posunuti-122+96) : chr(ord($text[$i])+$posunuti);
}
return $text_new;
}
Určitě to půjde ještě zjednodušit
