时间:2021-07-21人气:-
function ox_baidu_url_submit($tids){ foreach ($tids as $key=>$value){ $urls[] = 'http://你的域名/forum.php?mod=viewthread&tid='.$value; } $api = 'http://data.zz.baidu.com/urls?site=你的域名&token=你的Tonken'; $ch = curl_init(); $options = array( CURLOPT_URL => $api, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => implode("n", $urls), CURLOPT_HTTPHEADER => array('Content-Type: text/plain'), ); curl_setopt_array($ch, $options); $result = curl_exec($ch); return $result;}复制代码