PHP头条
热点:

php获取bing每日壁纸的示例


 这篇文章主要介绍了使用php获取bing每日壁纸的示例,需要的朋友可以参考下

 

代码如下:

<?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');

 }

?>

 

 

www.phpzy.comtrue/php/29593.htmlTechArticlephp获取bing每日壁纸的示例 这篇文章主要介绍了使用php获取bing每日壁纸的示例,需要的朋友可以参考下 代码如下: ?php $str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0n=1'); if(preg_matc...

相关文章

    暂无相关文章

PHP之友评论

今天推荐