ホームページ  >  記事  >  バックエンド開発  >  毎日Bingを取得するphpの共有例 壁紙_PHPチュートリアル

毎日Bingを取得するphpの共有例 壁紙_PHPチュートリアル

WBOY
WBOYオリジナル
2016-07-13 10:36:531223ブラウズ

复制代码代码如下:

$str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1');
if( preg_match("/(.+?)/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');
}
?>

www.bkjia.comtru​​ehttp://www.bkjia.com/PHPjc/736855.html技術記事复制代码代码如下: ?php $str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0 if(preg_match("/url(.+?)/url/ies",$str) ,$matches)){ $imgurl='http://cn.bing.com...
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。