时间: 2019-05-29 11:11 阅读: 次 作者:素材无忧网
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; } 复制代码 |
版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!