aadu
aadu

Reputation: 3254

Parsing XML special characters using PHP

I'm pulling information from an XML document using PHP and echoing it to a page. In the XMl document there are special characters like Éamon for example. And when I echo these characters using PHP it looks like Éamon.

Can anyone tell me how I can trans-code these characters so they parse normally?

Upvotes: 1

Views: 745

Answers (2)

Abhishek
Abhishek

Reputation: 836

You can use

<meta http-equiv='Content-Type' content='Type=text/html; charset=utf-8'>

Upvotes: 1

user377628
user377628

Reputation:

You can just have the browser do it for you. In the header, specify that your character set is utf-8:

header('Content-Type: text/html; charset=utf-8');

Do this before you output anything else to the browser. Now the browser will correctly decode the special characters.

Upvotes: 1

Related Questions