POST value XML contains &quot; the PHP is truncating
<p>I have a POST METHOD </p>

<pre><code>$ab = $_POST['xml'];
</code></pre>

<p>xml data is the following:</p>

<pre><code>&lt;email CommunicationType="Email" SourceSystem="GPS" TemplatePageZone="" brand="THORN" channel="THORN" emailAddr="mallu@THORN.com" template="tttt_09999_TEST"&gt;
  &lt;communicationTypes&gt;
    &lt;communicationType Name="EMAIL" Value="PETERS@THORN.com" isRequired="Y" /&gt;
    &lt;communicationType MobileTemplateID="12345" Name="COMM" OptInUrl="OptInUrl" Value="1234567890" isPartialOrFull="" isRequired="Y" template="88888" /&gt;
  &lt;/communicationTypes&gt;
  &lt;name firstName="**SMITH&amp;quot;** SON" lastName="" middleInitial="" /&gt;
  &lt;order orderDate="05/16/2013" orderHeaderKey="287346JSDV" orderIdATG="THORN01-23423415" orderNoEOMS="THORN01-22324323015" &gt;
    &lt;creditCard card="" numbersss="" /&gt;
    &lt;digitalCoupons digitalCouponTotal="0.00" /&gt;
    &lt;lineItems /&gt;
  &lt;/order&gt;
  &lt;account atgProfileId="" cirisID="" info="" password="" /&gt;
  &lt;comments /&gt;
&lt;/email&gt;
</code></pre>

<pre class="lang-php prettyprint-override"><code>$xmlmain = simplexml_load_string($ab);
</code></pre>

<p>The issue is the $xmlmain cannot load the <code>$ab</code>, because of the special character <code>SMITH&amp;quot;</code></p>

<p>Everthing after SMITH gets truncated. I sent the EMAIL with variable <code>$xmlmain</code> to myself and I see everything after is truncated. And this leads to the following failure as well since the XML is not read. </p>

<pre><code>$template_XMLMAIN =  $xmlmain-&gt;attributes()-&gt;template;  //This should be tttt_09999_TEST
</code></pre>

<p>Why I cannot read the XML? Thank You.</p>

<p>PS: This is the way the XML is going to be sent to me, cannot change it from the client side to me.</p>
