To an XML format and a server address, how to write interfaces in PHP

Source: Internet
Author: User
To an XML format and a server address, how to write an interface with PHP
I am writing recently, I do not know how Daniel will write, want to learn
^............

------Solution--------------------
What's the interface for?
------Solution--------------------
This is the commit data, the invocation is simple, direct fso_get_contents, and then parse the XML on the line
$url = "Https://xxx.com/xml";

$ch = Curl_init ($url);
$headers = Array (
"POST". $url. " Http/1.0 ",
"Content-type:text/xml;charset=\" utf-8\ "",
"Accept:text/xml",
"Content-length:". strlen ($xmlcontent),
);
$ch = Curl_init ();
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, Curlopt_returntransfer, 1);
curl_setopt ($ch, curlopt_timeout, 60);
curl_setopt ($ch, Curlopt_httpheader, $headers);
curl_setopt ($ch, curlopt_ssl_verifypeer,0);

Apply the XML to our curl call
curl_setopt ($ch, Curlopt_post, 1);
curl_setopt ($ch, Curlopt_postfields, $xmlcontent);

$data = curl_exec ($ch);
if (Curl_errno ($ch)) {
Die (' Meeting information error, it's possible the meeting hasn't started yet! ');
Exit
} else {
Show me The result
Var_dump ($data);
Curl_close ($ch);
}
------Solution--------------------
discuss

What's the port of PHP? Is it a male or a female?

Is the public study data
It's the mother. Output XML for others to analyze
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.