使用PHP的sleep函数可以实现延时加载。将代码放到sleep函数中即可。

function getydll($url) {
	$url = 'https://apistore.aizhan.com/baidurank/siteinfos/79bd537a7e2029d566c8331968512526?domains='.$url;
	$html = file_get_contents($url);
	$url = str_replace('.','\.',addslashes($url));
	$search = '/m_ip":"(.*?)"/';
	preg_match($search, $html, $Date);
	if($Date[1]){
		return $Date[1];
	}else{
		return '0';
	}
}

sleep(10);
getydll($url);

在调用getydll函数之前,使用sleep(10)来让代码延时10秒钟再加载。

PHP代码延时加载: 使用sleep函数实现10秒延迟

原文地址: https://www.cveoy.top/t/topic/HLg 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录