tags:

views:

30

answers:

1

I am doing some stuff that needs to output xml(utf-8) using PHP scripts. It has strict format requirements, which means the xml must be well formed. I know 'htmlspecialchars' to escape, but I don't know how to ensure that. Is there some functions/libraries to ensure everything is well formed?

+3  A: 

You can use PHP DOM or SimpleXML. These will also handle escaping for you.

Matthew Flaschen