当前位置:Gxlcms > PHP教程 > php获取通过http协议post过来的xml数据

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

时间:2021-07-01 10:21:17 帮助过:23人阅读

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

人气教程排行