<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> <?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]; } ?> <style type="text/css"> body {background-image: url("<?php echo $imgurl; ?>");} </style> </head> <body> </body> </html>