blocks # $encoded = ""; $preview = ""; $untouched = ""; if (isset($HTTP_POST_VARS['html'])){ // If the server has "register_globals = Off" then this question is very nesceary $html = $HTTP_POST_VARS['html']; // and this one to. if (get_magic_quotes_gpc() == 0){ $html = str_replace( '\"','"',$html); } $enter = chr(13); $untouched = $html; // $arr2 = array_keys($translation_table); // for($i=0;$i";//.$translation_table[]][]."
"; // } // HTML_ENTITIES and strtr(), cuold present troubles regarding characters asociated with non english language like �, �, �, � // and all the other vowels and all their acentuation marks, if the server that is running php is configured in english. // This simple version does not give trouble in any server, thus it doesnt use any translation table, // nor translates non english characters... // $translation_table = get_html_translation_table(HTML_ENTITIES); // Results may vary, depending on the translation list in the server used // $arr = array_values($translation_table); // $translation_table[chr(38)] = '&'; // $html = preg_replace( "/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,4};)/", "&" , strtr( $html, $translation_table)); // Si se descomentan las 4 lineas superiores a esta linea, se deben comentar las 2 inferiores a la misma. $arrayPatern = array("<" , ">" , " " , "<br>",$enter); $arrayReplace = array("<",">","  ","
","
"); for ($i =0;$i HTML ENCODE WIDGET

SimpleCode

Enter normal (X)HTML in the markup box below. Press "Process" and it will spit out entity-encoded markup suitable for <code> examples. Use spaces in increments of two for nesting indents.

Enter Markup


Cut n' Paste

Preview