首页  >  文章  >  后端开发  >  php获取通过http协议post过来的xml数据

php获取通过http协议post过来的xml数据

WBOY
WBOY原创
2016-07-25 09:10:14799浏览
  1. $xml_data =''.
  2. ''.
  3. '1234567890'.
  4. 'lgsoftwares'.
  5. 'mypassword'.
  6. 'phpmind.com'.
  7. '
  8. '.
  9. ''.
  10. ''.
  11. ''.
  12. '
  13. '.
  14. ''.
  15. 'JHM'.
  16. 'OGGSHE'.
  17. '101009'.
  18. '101509'.
  19. '1'.
  20. '
  21. '.
  22. '
  23. ';
  24. $URL = "https://www.abc.com/path/";
  25. $ch = curl_init($URL);
  26. curl_setopt($ch, CURLOPT_MUTE, 1);
  27. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  28. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  29. curl_setopt($ch, CURLOPT_POST, 1);
  30. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
  31. curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data");
  32. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  33. $output = curl_exec($ch);
  34. curl_close($ch);
  35. ?>
复制代码


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn