我有一个 POST 方法
$ab = $_POST['xml'];
xml数据如下:
<email CommunicationType="Email" SourceSystem="GPS" TemplatePageZone="" brand="THORN" channel="THORN" emailAddr="mallu@THORN.com" template="tttt_09999_TEST">
<communicationTypes>
<communicationType Name="EMAIL" Value="PETERS@THORN.com" isRequired="Y" />
<communicationType MobileTemplateID="12345" Name="COMM" OptInUrl="OptInUrl" Value="1234567890" isPartialOrFull="" isRequired="Y" template="88888" />
</communicationTypes>
<name firstName="**SMITH"** SON" lastName="" middleInitial="" />
<order orderDate="05/16/2013" orderHeaderKey="287346JSDV" orderIdATG="THORN01-23423415" orderNoEOMS="THORN01-22324323015" >
<creditCard card="" numbersss="" />
<digitalCoupons digitalCouponTotal="0.00" />
<lineItems />
</order>
<account atgProfileId="" cirisID="" info="" password="" />
<comments />
</email>
$xmlmain = simplexml_load_string($ab);
$ab
问题是 $xmlmain由于特殊字符而无法加载SMITH"
史密斯被截断后的一切。我将带有变量的 EMAIL 发送$xmlmain
给自己,然后我看到所有内容都被截断了。由于未读取 XML,这也会导致以下失败。
$template_XMLMAIN = $xmlmain->attributes()->template; //This should be tttt_09999_TEST
为什么我无法读取 XML?谢谢你。
PS:这是将 XML 发送给我的方式,不能将它从客户端更改给我。