>  기사  >  백엔드 개발  >  php获取通过http协议post过来的xml数据

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

WBOY
WBOY원래의
2016-07-25 09:10:14743검색
  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으로 문의하세요.