I got confused about entering special characters into my database now ...
For example, I want to accept characters like ö , ù , etc., and I want to display them as they are in html, for example Löic , which is a French name.
And I thought I should convert these special characters to html objects before entering them into a database like ö for ö .
If I use htmlspecialchars() to convert them,
Array ( [name] => Löic ) if(isset($_POST['name'])) $name = preg_replace('/\s\s+/', ' ', trim($_POST['name'])); $name = htmlspecialchars($name, ENT_QUOTES);
Therefore, it must be converted to this Löic , but it is not converted at all, and not as it is,
Löic
So this is what I get when I check my database, it is saved as
Löic
If I use htmlentities() to convert them,
$name = htmlentities($name, ENT_QUOTES);
then I get it
Löic
and it displays like this on my html,
Löic
Why is this so? My head will explode! I do not know where the problem is. Please help ... What should I do to do it right?
Is this related to utf8_general_ci , which I set in the name column?
Thanks.