Home > php教程 > php手册 > php获取bing每日图片

php获取bing每日图片

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 19:33:03
Original
1932 people have browsed it

简单的做了一个php的 DzzOffice 源码与演示: 演示出处 ?php$str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0n=1');if(preg_match("/url(.+?)\/url/ies",$str,$matches)){$imgurl='http://cn.bing.com'.$matches[1];}if($imgurl){heade

简单的做了一个php的
DzzOffice

源码与演示: 演示出处

<?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');
	}
?>
Copy after login
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template