PHP: convert all UTF-8 characters to HTML entities
PHP Snippet 1:
echo encodespecial('? ? Hello World ? ? ? this is a test....');
function encodespecial($str) {
$convmap = array(0x80, 0xfffffff, 0, 0xfffffff);
return mb_encode_numericentity($str, $convmap, 'UTF-8');
}