Php 获取$\u请求中的值数组
我有这个代码来获取数组中的xmlPhp 获取$\u请求中的值数组,php,xml,Php,Xml,我有这个代码来获取数组中的xml $d_atahipay = $_REQUEST['xml']; $xml = new SimpleXMLElement($d_atahipay); 但我总是有这样的错误:致命错误:未捕获的异常“exception”,消息“String无法解析为XML” 请求的内容通过序列化($\u请求)是: a:1:{s:3:"xml";s:778:"<?xml version="1.0" encoding="UTF-8"?> <mapi><ma
$d_atahipay = $_REQUEST['xml']; $xml = new SimpleXMLElement($d_atahipay);
但我总是有这样的错误:致命错误:未捕获的异常“exception”,消息“String无法解析为XML”
请求的内容通过序列化($\u请求)代码>是:
a:1:{s:3:"xml";s:778:"<?xml version="1.0" encoding="UTF-8"?>
<mapi><mapiversion>1.0</mapiversion><md5content></md5content><result><operation>capture</operation><status>ok</status><date>2015-10-22</date><time>16:23:56 UTC+0000</time><origAmount>78.00</origAmount><origCurrency></origCurrency><idForMerchant>r</idForMerchant><emailClient></emailClient><idClient></idClient><merchantDatas> <_aKey_idclient></_aKey_idclient></merchantDatas><cardCountry>FR</cardCountry><ipCountry>MG</ipCountry><transid></transid><is3ds>No</is3ds><paymentMethod>VISA</paymentMethod><customerCountry>MG</customerCountry><returnCode/><returnDescriptionShort/><returnDescriptionLong/></result></mapi>
";}
a:1:{s:3:xml;s:778:
1.0captureok2015-10-2216:23:56 UTC+000078.00r FRMGNoVISAMG
";}
那么有人可以帮我获取xml内容吗
谢谢能否发布打印请求($\u请求)?如果要将XML发布到服务器,是否需要将其添加到字段?标准方法是使用application/XML
或text/XML
直接将XML作为内容发布,并从php://input
。看来$\u请求['xml']
确实包含有效的xml。