There is a MySQL database containing data with accentuated letters like é. I want to display it in my PHP page , but the problem is that there are unrecognized characters displayed because of the accent. So is there a function to convert accent to HTML code , for example é is converted to é !
There is a MySQL database containing data with accentuated letters like é . I
Share
Rather than using
htmlentitiesyou should use the unicode charset in your files, e.g.To be on the safe side, you can add the following meta tag to your html files:
Then, make sure that your data base connection uses utf8:
Then, all browsers should display the special characters correctly.
The advantage is that you can easily use unicode characters everywhere in your php files – for example the copyright sign (©) or a dash (–) – given that your php files are encoded in utf-8, too.