Skip to main content

Completely convert string to html entities

$convmap = [0, 0x1FFFFF, 0, 0x10FFFF];

$str = mb_encode_numericentity('StringToBeEncoded', $convmap);

echo $str;