Mega Code Archive

 
Categories / Php / Strings
 

ASCII Table

<?php session_start(); $table = ""; $table .= "<center><table width=50% cellspacing=0 cellpadding=3 bgcolor=#f0f0f0>"; $table .= "<tr>"; $table .= "<td bgcolor=#000080 colspan=8>"; $table .= "<font color=white><b>"; $table .= " A S C I I - T a b l e"; $table .= "</b></font>"; $table .= "</td>"; $table .= "<td bgcolor=#000080 colspan=8 align=right>"; $table .= "<select onChange=\"javascript:window.location.search='font=' + this.value;\" name=fontlist>"; $table .= "<option value=Arial"; if($_GET["font"] == "Arial") $table .= " selected"; $table .= ">Arial"; $table .= "<option value=Garamond"; if($_GET["font"] == "Garamond") $table .= " selected"; $table .= ">Garamond"; $table .= "<option value=Tahoma"; if($_GET["font"] == "Tahoma") $table .= " selected"; $table .= ">Tahoma"; $table .= "<option value=Verdana"; if($_GET["font"] == "") $table .= " selected"; if($_GET["font"] == "Verdana") $table .= " selected"; $table .= ">Verdana"; $table .= "<option value=Webdings"; if($_GET["font"] == "Webdings") $table .= " selected"; $table .= ">Webdings"; $table .= "<option value=Wingdings"; if($_GET["font"] == "Wingdings") $table .= " selected"; $table .= ">Wingdings"; $table .= "</select>"; $table .= "</td>"; $table .= "</tr>"; $table .= "<tr>"; for($count = 1; $count <= 256; $count++) { $table .= "<td align=right class=count>"; $table .= $count; $table .= "</td>"; $table .= "<td bgcolor=#ffffff align=middle class=char>"; $table .= chr($count); $table .= "</td>"; if($count % 8 == 0) $table .= "</tr><tr>"; } $table .= "</tr>"; $table .= "</table>"; ?> <html> <head> <title>Geerson - Ascii table</title> <style> td, select { font-family : Verdana; font-size : 8pt; } td.char { font-family : <?php if($_GET["font"] != "") echo($_GET["font"]); else echo("Verdana"); ?>; } </style> </head> <body bgcolor=#808080> <?php echo($table); ?> </body> </html>