给站点创建必应php应用到图片放置处

发布时间:2021-04-14

给站点新建php文件 随意命名

将链接放置在你需要展示图片的位置即可

代码:

<?php
$str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1');
if(preg_match("/<url>(.+?)<\/url>/ies",$str,$matches)){
    $imgurl='http://cn.bing.com'.$matches[1];
}
if($imgurl){
    header('Content-Type: image/JPEG');
    @ob_end_clean();
    @readfile($imgurl);
    @flush(); @ob_flush();
    exit();
}else{
    exit('error');
}
?>

打赏


哇 你要支持我吗?太慷慨了!谢谢
上一篇
下一篇