$info):
$isPrintable = ($code > 31 && $code < 127);
$print = $isPrintable ? chr($code) : $info[1];
$attrs = ['data-key-code' => $code, 'data-key-desc' => $info[0], 'data-key-print' => $print, 'data-copy' => $print];
$attrStr = '';
if($isPrintable && isset($info[1]))
$attrs['data-key-html'] = $info[1];
foreach($attrs as $name => $value)
$attrStr .= $name . '="' . htmlentities($value) . '" ';
?>
>
=$print;?>
=$info[0];?>
HTML
&=$attrs['data-key-html'];?>;