Save Special characters in XML

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jamesm6162
Forum Newbie
Posts: 13
Joined: Sat Jun 28, 2008 10:31 am

Save Special characters in XML

Post by jamesm6162 »

I have a form where users enter a paragraph, which I then save in an XML file, using PHP.

However, as soon as someone copies a special character (i.e. “ - character, not the normal double quote, but ‘ numerical entity.) Then the value is not saved to the XML file at all, but leaves an empty element.

That is when I do not specify any Character encoding in my XML document.

Whats more, this problem only occurs on the remote server, and not my localhost.

Does anybody know how I can fix it?
Post Reply