How to Construct xml in php with Special Characters?

Posted by Ramakrishnan on Stack Overflow See other posts from Stack Overflow or by Ramakrishnan
Published on 2010-05-26T11:08:36Z Indexed on 2010/05/26 11:11 UTC
Read the original article Hit count: 334

Filed under:
|

My user enters message with special characters as follows:

this is a test of &&, &&, % as well as '' "", " instead of this is a test of &, &&, % as well as '' "", "

I need to construct XML as follows:

<?xml version='1.0' encoding='iso-8859-1'?>
<success>
<message>
this is a test of &amp;, &amp;&amp;, % as well as '' &quot;&quot;, &quot; instead of this is a test of &, &&, % as well as '' "", "
</message>
</success>

Can any body help me? Thanks in advance

© Stack Overflow or respective owner

Related posts about php

Related posts about Xml