给一个xml格式和一个服务器地址,怎么用php写接口 我最近正在写,不知道大牛们会怎么写,想学习学习^………… 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 php 接什么口?是公还是母?是公就读数据是母就输出xml 让别人来分析 这是提交数据,调用就简单了,直接fso_get_contents,然后分析xml就行了$url="https://xxx.com/xml";$ch = curl_init ($url);$headers = array( "POST ".$url." HTTP/1.0", "Content-type: text/xml;charset=\"utf-8\"", "Accept: text/xml", "Content-length: ".strlen($xmlcontent),);$ch = curl_init();curl_setopt($ch, CURLOPT_URL,$url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_TIMEOUT, 60);curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,0);// Apply the XML to our curl callcurl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlcontent);$data = curl_exec($ch);if (curl_errno($ch)) { die('会议信息出错,有可能会议还未开始!'); exit;} else { // Show me the result //var_dump($data); curl_close($ch);} 文件下载的问题 求教一个问题 求助啊!!!! 一个函数怎么加 tolower 一个超复杂的xml文档解析 preg_replace的参数的正则替换问题 !! file_get_contents问题 整理下问题,再重新问,关于dotProject~~ 给PHP版的高人们一个难题,这个网页的保护功能是如何实现的???? 请问各位老大一个性能问题 - 100分必散 -#-高分求解-#- 我已经郁闷了好几天了!!!!!!! 该如何清空$_POST里的数据? 用表格输出数据表中的数据
是母就输出xml 让别人来分析
$url="https://xxx.com/xml";$ch = curl_init ($url);
$headers = array(
"POST ".$url." HTTP/1.0",
"Content-type: text/xml;charset=\"utf-8\"",
"Accept: text/xml",
"Content-length: ".strlen($xmlcontent),
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,0);// Apply the XML to our curl call
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlcontent);$data = curl_exec($ch);
if (curl_errno($ch)) {
die('会议信息出错,有可能会议还未开始!');
exit;
} else {
// Show me the result
//var_dump($data);
curl_close($ch);
}