this snippet shows all characters as chr(), html-entity and URLencoded

html entities” makes use of the built-in PHP functions htmlentities( ), chr( ), htmlspecialchars( ) and urlencode( ).

01 <?php
02 
03 echo '
04 <table style="width: 40em; 
05     font-family: Verdana, sans-serif; 
06     font-size: smaller; 
07     margin: 1em; 
08     border: 0.1em solid #555;
09     border-collapse: collapse;">
10     <tr style="background: #555; color: #fff">
11         <td style="width: 9.7em; padding-left: 0.3em;">char</td>
12         <td style="width: 10em;">PHP</td>
13         <td style="width: 10em;">HTML</td>
14         <td>URLencode</td>
15     </tr>';
16  
17 for($x = 34; $x <= 255; $x++)
18     echo '
19     <tr style="background: #f'.(($x % 2)*2).'f'.(9-(($x % 2)*9)).'f'.(($x % 2)*9).';">
20         <td style="padding-left: 0.3em;">'.htmlentities(chr($x)).'</td>
21         <td>chr('.$x.')</td>
22         <td>'.htmlspecialchars(htmlentities(chr($x))).'</td>
23         <td>'.urlencode(chr($x)).'</td>
24     </tr>';
25  
26 echo '
27 </table>';
28  
29 ?>