欢迎光临
我们一直在努力

爱客影院3.5自动更新尝鲜代码

将下面代码加入到Index.php的include (‘./inc/aik.config.php’);下面:

//自动更新尝鲜地址开始
function getContents($url){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
    ob_start();
    curl_exec($ch);
    ob_end_clean();
    $x = curl_getinfo($ch);
    curl_close($ch);
    return $x;
}



$contents = getContents($aik['zhanwai']);
$urls =  $contents['url'];
if($aik['zhanwai'] != $urls){
    $aik['zhanwai'] = $urls;
     file_put_contents('./inc/aik.config.php',"<?php\n \$aik =  ".var_export($aik,true).";\n?>");
 }
//自动更新尝鲜地址结束

赞(0)
未经允许不得转载:阿强爱分享 » 爱客影院3.5自动更新尝鲜代码

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址