PHP:将iso-8859-1编码的字符转换为html实体

I have a string like the following:

$test = "<div style=\"font-weight:bold;\">\334berraschung!</div>";

When I output this as it is on a web page, it displays correctly:

Überraschung!

...because \334 is the code for Ü in ISO-8859-1. But what I need, is the Html-Entity of the character (and of the whole string, so a replacement for all these ...-Characters), which in this case would be:

&Uuml;berraschung!

or even better the Unicode entity

&#220;berraschung!

How can I convert this in PHP?