Generic Elite Translator'; if($q){ //This line allows users to enter querys throught the url //ie translator.php?q=i+went+to+the+store $input=str_replace('+',' ',$q); }else{ if($_POST['input']){ $input=$_POST['input']; }else{ $input=""; } } //Put the words you want to translate here //they should follow the word=>new word format //one translation per line $replace="i=>1 o=>0 e=>3 a=>4 s=>5 g=>6 t=>7 b=>8 b=>9 d=>|} r=>|2 m=>M q=>Q h=>H c=>C k=>K u=>U l=>L "; if($input){ //breaks the input down by line $replace=explode("\n",$replace); $i=0; $end=0; $input=StripSlashes($input); $output=str_replace("'", '’', $input); while($end!='1'){ if($replace[$i]){ //Breaks the input down into the old word/phrase and the new word/phrase $each=explode('=>',$replace[$i]); //replaces the old word with the new word //the replacement must have a space on each side //this prevents interword translation, but does not take punctuation into account $output=preg_replace('/('.preg_quote($each[0], '/').')/i',$each[1],$output); $i++; }else{ $end='1'; } } echo ''.$input.'

translates to

'; //Makes the hard line breaks appear $output = str_replace("\n", "
", $output); echo ''.$output.''; echo '

'; } echo'

'; display_bottom(); ?>