Code:
// Let's define our key here
 $key = 'G4E';
 
 // Our plaintext/ciphertext
 $text = 'Programming Forums';
 
 // Our output text
 $outText = '';
 
 // Iterate through each character
 for($i=0;$i<strlen($text);$i++) // Dont need to increment here
 {
     for($j=0;$j<strlen($key);$j++)
     {
         $outText .= $text{$i} ^ $key{$j};
     }
 }

Last edited by shabbir; 8Aug2009 at 10:00.. Reason: Code blocks