<&#63;phpfunction postUrl($url, $postvar){ $ch = curl_init(); $headers = array( "POST".$url."HTTP/1.0", "Content-type: text/xml; charset=/"gb2312/"", "Accept: text/xml", "C " /> 久久se精品一区二区,625成人欧美午夜电影,亚洲精品一二三

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

php使用百度ping服務代碼實例

代碼實例:

<?phpfunction postUrl($url, $postvar){  $ch = curl_init();  $headers = array(    "POST".$url."HTTP/1.0",    "Content-type: text/xml; charset=/"gb2312/"",    "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 version=/"1.0/" encoding=/"gb2312/"?><methodCall>  <methodName>weblogUpdates.extendedPing</methodName>  <params>    <param><value><string>愚人渡</string></value></param>    <param><value><string>http://www.jb51.NET</string></value></param>    <param><value><string>http://www.jb51.NET/read.php?tid-96.html</string></value></param>    <param><value><string>http://www.jb51.NET</string></value></param>  </params></methodCall>";$res = postUrl('http://ping.baidu.com/ping/RPC2', $baiduXML);if ( strpos($res, "<int>0</int>") ){  echo "PING成功";}else{  echo "PING失敗";}?>

php技術php使用百度ping服務代碼實例,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 武鸣县| 左云县| 白河县| 互助| 阳江市| 崇州市| 娱乐| 峨山| 巩义市| 利津县| 清河县| 铜山县| 夏邑县| 湾仔区| 灌阳县| 遂平县| 怀柔区| 安龙县| 南涧| 铁岭县| 洛扎县| 金平| 北宁市| 萍乡市| 白玉县| 平阴县| 商都县| 广南县| 乐平市| 乐清市| 灯塔市| 仲巴县| 宁陵县| 泰顺县| 舟曲县| 安康市| 凤阳县| 枝江市| 泗洪县| 乌鲁木齐县| 岗巴县|