For an xml format and a server address, how can I use the php write interface? I am writing it recently. I do not know how the experts will write it. I want to learn ^ ............ ------ Solution -------------------- what interface should be provided? ------ Solution ------------------ This is the data submission, and the call is simple. directly fso_get_contents, and then analyze the xml. $ url & quot; h is used to give an xml format and a server address, how to use the php write interface
I have been writing about it recently. I don't know how to write it. I want to learn it.
^ ............
------ Solution --------------------
What is the interface?
------ Solution --------------------
This is data submission. the call is simple. you can directly use fso_get_contents and then analyze the xml.
$ 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 is possible that the meeting has not started yet! ');
Exit;
} Else {
// Show me the result
// Var_dump ($ data );
Curl_close ($ ch );
}
------ Solution --------------------
Discussion
What Port does php connect? Is it a male or a mother?
Public data
Output xml for Analysis by others as the mother