htmlentities()

if you are reading my post here today its probably because you have a website with spanish language characters like

example:

Iniciar Sesi�n should look like: Iniciar Sesión

Contrase�a should look like Contraseña


as you can see, Contraseña should looke like this: Contraseña but instead it looks like this Contrase�a on my firefox browser. so how do you fix this..

well, to fix this in php its very easy. all you have to do is use the htmlentities() function when you declare your variables.

for example, i have a language file and the login variable is:

$lang['password'] = htmlentities('Contraseña');

thats it. just make sure you use htmlentities to display them. sometimes this is helpful when you are also getting information language like this from your database like mysql. this problems can be resolve with this php function. that way you wont have any trouble displaying it the correct way. thats why php is the worlds best web programming language because you can solve problem like this with foreing letters and number with accent like the latin keys

hope this helps