I have a problem with decoding htmlentities from a Mysqldatabase. I imported all the data from a text file in which all this encoded words occur. But I want them to be displayed in readable form on my testpage:http://www.localtouch.nl/aabase/test.php.
At the start of my page I tested the html_entity_decode and it works:
PHP:
<?php
$orig = "De hele wereld komt samen in dit kleine en informele café. Hier leg je gemakkelijk contact met Amsterdammers, hier leer je Amsterdam kennen. Informeel en ongedwongen.";
$a = htmlentities($orig);
$b = html_entity_decode($a);
echo $b;
?>
As expected this correctly displays the word cafĂ©. However if I retreive the same string from Mysql I get café
I use the following code to get the variable from mysql
PHP:
<?php
echo html_entity_decode(htmlentities($row_Recordset1['shorttext_nl']));
?>
Now if I remove the ; ending from é the word is displayed in decoded form as I want it. I could remove all the ; but that creates other problems so I was hoping someone knows a better solution. Any ideas?