answered question
1
Vote
Vote
1
Answer
Answer
M$1.00
How can I convert HTML entities to their actual characters in PHP?
I have a MySQL database full of data that has HTML entities in some fields. I'm pulling that data out and serving it in a format (XML) that needs those entities to be their actual symbols, not the entities. How can I convert these in PHP?
voted interesting: socalsue
answers (1)
Could you provide an example? I'm not quite sure what you are referring to.
| Asker's rating: |
Related questions
140 characters left













I'll throw the example out there anyway for anyone who reaches this page through a search.
I had something in quotes, like so: "This is quoted." This data had to be outputted into an XML file, generated by PHP. "This is quoted." was the data inside of the database -- with HTML entities instead of simple quotations.
All I had to do to display this properly, without entities (using the actual symbols) was to use the html_entity_decode function, like so:
$data = html_entity_decode($data);
I have a feeling that Mahalo will not display that properly, so if that's the case, here's a pastie of it: http://pastie.textmate.org/532635
Thanks for offering to help, though!