Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 获取$\u请求中的值数组_Php_Xml - Fatal编程技术网

Php 获取$\u请求中的值数组

Php 获取$\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

我有这个代码来获取数组中的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><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。