How to convert HTML character NUMBERS to plain characters in PHP?

ViCDiaBLiTo

New Member
I have some HTML data (over which I have no control, can only read it) that contains a lot of Scandinavian characters (?, ?, ?, ?, ?, etc.). These "special" chars are stored as HTML character numbers (? = \[code\]æ\[/code\]). I need to convert these to the corresponding actual character in PHP (or JavaScript but I guess PHP is better here...). Seems like \[code\]html_entity_decode()\[/code\] only handles the "other" kind of entities, where ? = \[code\]\[/code\]. The only solution I've come up with so far is to make a conversion table and map each character number to a real character, but that's not really super smart...So, any ideas? ;)Cheers,Christofer
 
Back
Top