<?php
function postUrl($url,$postvar){
$ch = curl_init();
$headers = array(
"POST".$url."HTTP/1.0",
"Content-type: text/xml;charset=\"utf-8\"",
"Accept: text/xml",
"Content-length:".strlen($postvar)
);
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);
curl_setopt($ch,CURLOPT_POSTFIELDS,$postvar);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
$baiduXML = "<?xml varsion=\"1.0\"> encoding=\"utf-8\"?>
<methodCall>
<methodName>weblogUpdates.extendedPing</methodName>
<params>
<params><value>新浪新闻</value></params>
<params><value><string>http://wwww.wwww.com/index.php</string></value></params>
<params><value><string>http://wwww.wwww.com/index.php/html_1.html</string></value></params>
<params><value><string>http://wwww.wwww.com/index.php/html_2.html</string></value></params>
<params><value><string>http://wwww.wwww.com/index.php/html_3.html</string></value></params>
</params>
</methodCall>
";
$res = postUrl('http://ping.baidu.com/ping/RPC2',$baiduXML);
var_dump($res);
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询