<?php
/* L33t Converter - by dark2k1(dark2k1.com)

Translate n00b language into plain english.
*/

function text_to_l33t($text) {
$text = str_replace("you", "j00", $text);
$text = str_replace("a", "@", $text);
$text = str_replace("b", "|3", $text);
$text = str_replace("e", "3", $text);
$text = str_replace("h", "|-|", $text);
$text = str_replace("i", "1", $text);
$text = str_replace("o", "0", $text);
$text = str_replace("f", "ph", $text);
$text = str_replace("d", "|)", $text);
$text = str_replace("k", "|<", $text);
$text = str_replace("t", "7", $text);
$text = str_replace("x", "><", $text);
$text = str_replace("ck", "x", $text);
$text = str_replace("v", "/", $text);
$text = str_replace("w", "//", $text);
$text = str_replace("s", "$", $text);
$text = str_replace(" ", "  ", $text);
return $text;
}

function l33t_to_text($text) {
$text = str_replace("j00", "you", $text);
$text = str_replace("@", "a", $text);
$text = str_replace("|3", "b", $text);
$text = str_replace("3", "e", $text);
$text = str_replace("|-|", "h", $text);
$text = str_replace("1", "i", $text);
$text = str_replace("0", "o", $text);
$text = str_replace("ph", "f", $text);
$text = str_replace("|)", "d", $text);
$text = str_replace("|<", "k", $text);
$text = str_replace("7", "t", $text);
$text = str_replace("><", "x", $text);
$text = str_replace("x", "ck", $text);
$text = str_replace("/", "v", $text);
$text = str_replace("//", "w", $text);
$text = str_replace("$", "s", $text);
$text = str_replace("  ", " ", $text);
return $text;
}

function converter() {
echo "
<center><h3>Converter</h3></center>

<form action='$PHP_SELF' method='post'>
<center>
<table width='10%'>
<tr><td><textarea rows='8' cols='40' name='text'></textarea></td></tr>
<tr><td align='center'>l33t to text<input type='radio' name='select' value='l33t_to_text'> text to l33t<input type='radio' name='select' value='text_to_l33t'></td></tr>
<tr><td colspan='2' align='center'><input type='hidden' name='func' value='process'><input type='submit' value='Convert'></td></tr>
</table>
</center>
</form>";
}

function process() {
global $text, $select;

	if($select == "l33t_to_text") {
	echo l33t_to_text($text);
	} elseif($select == "text_to_l33t") {
	echo text_to_l33t($text);
	}
}

switch($func) {
	default;
	converter();
	break;

	case "process";
	process();
	break;
}
?>
Name