Einzelnen Beitrag anzeigen
Alt 24.02.06, 13:27   #23 (permalink)
Tasmas
 
Registriert seit: 18.03.05
Tasmas Leistung: Facit NTK
Likes: 0
Standard

so hab das ganze in php doch noch hingekriegt:

PHP-Code:
<?php

function plain2caesar($input$diff)
        {    
            
$tmp strtoupper($input);
            
$signs = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
            
$anzahl count($signs);

            for (
$x 0$x $anzahl $x++)
            {
                
                if ( (
$x-$anzahl+$diff) >= )
                {
                    
$signs2[$signs{$x}] = $signs[$x-$anzahl+$diff];
                }
                else
                {
                    
$signs2[$signs{$x}] = $signs[$x+$diff];
                }
            }
            
            
print_r($signs2);
            
            
$strRet "";
            
            for(
$i 0$i strlen($tmp); $i++)
            {
                if (
in_array($tmp{$i}, $signs2))
                {
                      
$strRet .= $signs2[$tmp{$i}];
                }
                else
                {
                    
$strRet .= $tmp{$i};
                }
            }
            
            return 
$strRet;
        }
?>
mfg
Tasmas ist offline   Mit Zitat antworten
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61