Decoding Ascii to string UTF8

I have trouble on decoding a string like &#32&#33&#34&#35&#36&#37, somehow decoding with php function is not working... it might have to do something with the UTF8.


$email = explode('&#',$email);
foreach($email as $list)
{
if (!empty($list))
{
$string .= $this->unichr($list);
}
}
if (!empty($string))
{
$string = str_replace('mailto:','',$string);
}

function unichr($u) {
return mb_convert_encoding('&#' . intval($u) . ';', 'UTF-8', 'HTML-ENTITIES');
}

Subscribe to You Live What You Learn

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]
Subscribe