首頁  >  文章  >  後端開發  >  php取得透過http協議post過來的xml數據

php取得透過http協議post過來的xml數據

WBOY
WBOY原創
2016-07-25 09:10:14742瀏覽
  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. ?>
复制代码


陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn