爱客影院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?>");
 }
//自动更新尝鲜地址结束

阿强爱分享
  • 本文由 发表于 2018年10月13日13:19:38
  • 转载请务必保留本文链接:https://iooqp.cn/175.html
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: