Skip to content

Instantly share code, notes, and snippets.

@terremoth
Created January 31, 2022 07:29
Show Gist options
  • Select an option

  • Save terremoth/0fa78271c828c78a7b2710e8dbc7376b to your computer and use it in GitHub Desktop.

Select an option

Save terremoth/0fa78271c828c78a7b2710e8dbc7376b to your computer and use it in GitHub Desktop.
PHP print all ascii table 16bits 65535 chars in utf-8
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Supreme ASCII TABLE</title>
<style type="text/css">
html {
font-family: sans-serif;
}
table,th,td {
border: 1px solid black;
padding:5px;
margin: 3px;
white-space: pre;
}
table {
border-collapse: collapse;
}
td {
text-align: center;
font-size: 16pt;
}
</style>
</head>
<body>
<h2>All ASCII Table - Supreme</h2>
<table>
<thead>
<tr>
<th>DEC</th>
<th>OCT</th>
<th>HEX</th>
<th>BIN</th>
<th>REPRES</th>
<th>HTML Number</th>
<th>HTML Name</th>
<th>DESC</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $i <= 65535; $i++)
{
echo
'<tr>
<td>'.$i.'</td>
<td>'.decoct($i).'</td>
<td>'.dechex($i).'</td>
<td>'.decbin($i).'</td>
<td>&#'.$i.'</td>
<td>&# '.$i.'</td>
<td></td>
<td></td>
</tr>';
}
?>
</tbody>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment