PHP implements the code for querying the API interface on the mobile phone. Copy the code as follows :? Phpheader ("Content-Type: texthtml; charsetutf-8"); if (isset ($ _ GET [number]) {$ url 'webservice .webxml.com. cnWebServicesMobileCodeWS
The code is as follows:
Header ("Content-Type: text/html; charset = utf-8 ″);
If (isset ($ _ GET ['Number']) {
$ Url = 'http: // webservice.webxml.com.cn/webservices/mobilecodews.asmx/getmobilecodeinfo ';
$ Number = $ _ GET ['Number'];
$ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, $ url );
Curl_setopt ($ ch, CURLOPT_POST, true );
Curl_setopt ($ ch, CURLOPT_POSTFIELDS, "mobileCode = {$ number} & userId = ");
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true );
$ Data = curl_exec ($ ch );
Curl_close ($ ch );
$ Data = simplexml_load_string ($ data );
If (strpos ($ data, 'http ://')){
Echo 'mobile phone number format error! ';
} Else {
Echo $ data;
}
}
?>
The http://www.bkjia.com/PHPjc/325909.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/325909.htmlTechArticle code is as follows :? Php header ("Content-Type: text/html; charset = utf-8"); if (isset ($ _ GET ['Number']) {$ url = 'http: // webservice.webxml.com.cn/WebServices/MobileCodeWS...