I’m working with XML files, and sometimes I’m facing with an XML encoding problem, for example, instead of ö I’m getting ö. How can I fix this in php?
I’m working with XML files, and sometimes I’m facing with an XML encoding problem,
Share
Use
html_entity_decode(), example (from PHP manual):And your case specifically is covered here:
http://codepad.viper-7.com/4DIrsM
NB: The function’s 3rd parameter is the character set encoding. By default it is ISO-8859-1 (according to PHP manual), but most websites are in UTF-8, so you need to set the parameter yourself as I did above.