This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
<?php
/**
* 作者:LyLme
* 说明:用于获取Bing每日壁纸,以PHP文件返回图片
* 时间:2022-01-20
*/
$str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1');
if(preg_match("/<url>(.+?)<\/url>/is",$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');
?>