//抓取bing背景
$str = file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1'); // 从bing获取数据
if(preg_match('/
$imgurl = 'http://cn.bing.com'.$matches[1];
} else { // 如果由于某些原因,没抓取到图片地址
$imgurl = 'https://cdn.uc9.cn/Public/Home/Images/bg/th.jfif'; // 使用默认的图像(默认图像链接可修改为自己的)
}
$this->assign('imgurl', $imgurl);