PHP获取Bing每日一图

推荐新版

<?php 
$image = new DOMDocument(); 
$image->load('http://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=en-US');
$url = 'http://cn.bing.com' . $image->getElementsByTagName( "url" )[0]->nodeValue;
header('Content-Type: image/JPEG');
@ob_end_clean();
@readfile($url);
@flush();
@ob_flush();
    exit();
?>

以前用别人的地址,后来用别人的代码,现在自己写代码,以后......

tag(s): php, 必应, bing
show comments · back · home