using html_entitiy_decode

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

using html_entitiy_decode

Post by kendall »

hey guys...quick question on the function...

I'm using it to "decode" an htmlentities string but for some reason It doesn't decode the – and „. I practically had to do a str_replace for the most part in getting it converted.

What gives with this function? :dubious: :?:
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: using html_entitiy_decode

Post by requinix »

If get_html_translation_table doesn't know about the entity then PHP doesn't know either. And, of course, if it doesn't know then you can't expect it to do the conversion.

Until PHP's list of entities is updated you'll need to find another way. Do an html_entity_decode then your own set of str_replaces, or find a package out there that can do it all for you (I don't know of any).
Post Reply