This article provides a detailed analysis of the interface problems in php (the php interface mainly uses the curl and curl functions). For more information, see
This article provides a detailed analysis of the interface problems in php (the php interface mainly uses the curl and curl functions). For more information, see
Interface problems
The most important thing to call php interfaces is to use curl to capture information.
The Code is as follows:
$ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, $ url); // url
Curl_setopt ($ ch, CURLOPT_POST, true); // whether to post the request
Curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ data); // data transmitted by the post request
Curl_setopt ($ ch, CURLOPT_HTTPHEADER, $ header); // set the header
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true); // return the obtained output text stream
$ Response = curl_exec ($ ch); // obtain the returned data
Curl_close ($ ch); // close
, Hong Kong server, Hong Kong Server rental, Hong Kong server