Example, php Baidu Weather Thief program.
//Get search for xx in Baidu Weather information captured by (place name) weather
$url = "http://www.baidu.com/s?wd=%B1%B1%BE%A9%CC%EC%C6%F8"; // This is the return address for searching Beijing weather in Baidu
$content = file_get_contents($url);
preg_match_all('/
(.+?) /si',$content,$temp);
preg_match_all('/
(.+?) | /si',$temp[1][0],$temp1);
var_dump ($temp1[1][0]);
Output information:
string(243) "Beijing weather
Today: temperature 22℃ - 24℃. Daytime: cloudy, heavy showers, night: cloudy. East wind level 2 to level 1-2
Tomorrow: temperature 23℃ - 28℃. Daytime: cloudy, night time: southeasterly wind level 2"
http://www.bkjia.com/PHPjc/759965.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/759965.htmlTechArticleExample, php Baidu Weather Thief program. Copy the code as follows: ?php //Get the weather information captured by searching for xx (place name) weather in Baidu $url = "http://www.baidu.com/s?wd=%B1%B...
Statement: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