Method to decode XML entities?

189 views Asked by At

I am working on a PHP 5.3 production server, so html_entity_decode($, ENT_XML1) is not available.

My question is simple: What is the conversion method for example for Ÿ to a byte?

1

There are 1 answers

0
Cobra_Fast On
$str = preg_replace('/&#(\d+);/me', 'chr(\\1)', $str);

Seems to be a hack for this problem.
Found at http://php.net/html_entity_decode#47371.

But I still don't understand the logic behind it.