用php获取bing当日壁纸
众所周知,bing官网https://cn.bing.com/ 每日壁纸都是不一样的 如何获取当日的壁纸呢,只需下面的代码即可
<?php
$str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1');
$array=json_decode($str);
$url='https://cn.bing.com'.$array->images[0]->urlbase.'_1920x1080.jpg';
if($url){
header('Content-Type: image/JPEG');
@ob_end_clean();
@readfile($url);
@flush();
@ob_flush();
exit;
}else{
exit('error');
}
?>
版权声明:
作者:无用笔记
链接:https://www.xhily.com/489.html
来源:无用笔记
文章版权归作者所有,未经允许请勿转载。
THE END
0
二维码
打赏
海报


用php获取bing当日壁纸
众所周知,bing官网https://cn.bing.com/ 每日壁纸都是不一样的 如何获取当日的壁纸呢,只需下面的代码即可
<?php
$str=file_get_contents('http://cn.bin……

共有 0 条评论