//This funciton is modified from // http://ca.php.net/manual/en/function.html-entity-decode.php function unhtmlentities($string) { return preg_replace_callback('~&#([0-9][0-9])~', function ($matches) { return chr($matches); }, $string); } //~e is depracated function unhtmlentities_old($string) { return preg_replace('~&#([0-9][0-9])~e', 'chr(\\1)', $string); }