Home > Backend Development > PHP Tutorial > PHP obtains xml data posted through http protocol

PHP obtains xml data posted through http protocol

WBOY
Release: 2016-07-25 09:10:14
Original
806 people have browsed it
  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. ?>
复制代码


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template