一个分页的定时任务(curl实现) 的接口实现方式详解!
//定时任务,跳页面请求接口
public function meAPI(){
header("Content-type:text/html;charset=utf-8");
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$urlPage = C('ME')."/me.php/ME/meAPI/?page=".($page+1);
$cache=S('ii');//设置缓存标示
if(!$cache){
$newItems = ["1056018","1127006", "1127041", "1221004", "1223005", "1280012", "1116030", "1116031", "1143011", "1143016" , "1143021" , "1156099" , "1252025" , "1275011" , "1275015" , "1116016"];
S('ii',$newIs,15); //设置缓存的生存时间
}else{
$newIs = $cache;
}
//数组没有元素就中断执行
if (!count($newIs)) {