<?php
<?php
function hexentities($str) {
$return = '';
for($i = 0; $i < strlen($str); $i++) {
$return .= '&#x'.bin2hex(substr($str, $i, 1)).';';
}
return $return;
}
function show($str)
{
echo '<textarea rows=10 coln=25>'.$str.'
}
show(htmlentities('test'));