A creative and sometimes technical blog about Design and Programming as well as other things.

My Little 1337 (leet) Speak Generator

For fun in class the other day, I wrote a little “1337″ speak generator.  It’s written in PHP, and it consists of just one small script page.  (It has also come to my attention that there are various degrees of 1337, so I would consider my translation to be somewhat advanced.  1337 translation help from Wikipedia.)

Try it here.

/* Leet (1337) Speak generator! */
/* Takes ordinary words and turns them to computer geek gibberish. */

//Lets be able to use all those Post variables easily.
extract($_POST);

//Convert the text?
if(!empty($to_convert))
{
    $old = $to_convert; //Keep old text
    $find = 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');
    $repl = array('4','8',"&copy;",'[)','3','|=','6','#','1','_|','|< ','1','|v|','N','0','|*','Q','R','5','7','(_)','V','VV','>< ','Y','2');
    $to_convert = str_replace($find,$repl,strtolower($to_convert));
    echo "<p><b>".nl2br(stripslashes($to_convert))."</b><br />(".nl2br(stripslashes($old)).")";
}

//No text to convert, must be the Main Page.
echo "<form action='$PHP_SELF' method='post'>";
echo "Text to be converted:<br /><textarea id='to_convert' name='to_convert' rows='20' cols='35'></textarea>";
echo "<br /><input type='submit' value='1337 speak!'/>";
echo "</form>";
Share Me: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google


Leave a Reply


Copyright Mike Wojtkowski 2008; PHail [dot net] Blog - Design, Programming, and other things..
Powered by WordPress. Theme by Mike Wojtkowski.