We can use
PHP to grab the weather forecast absolutely streamlined code
- < form method="post">
-
< input name="a" type="text" id="a" />
-
< input type="submit" name="Submit" value="Check" /> ;
- < /form>
- < ?php
- $city = $_REQUEST["a"];
- if ($city=="")
- {
- $city="描泽";
- }
- $url = 'http://www.baidu.com/s?wd= '.$city.'Weather'; 🎜>($url); ('', $lines_array);
- eregi("Today ((.*)Today’s weather index", $lines_string, $body); $body[0]=strip_tags($body[0]); $body[0] = str_replace("Today’s Weather Index","",$body[ 0]);
- $body[0] = str_replace(" ","",$body[0]); echo $city.$body[0]; ?>
-
- The above code example is to capture the weather with PHP How to achieve forecasting.
-
http://www.bkjia.com/PHPjc/446178.html
- www.bkjia.comtrue
- http: //www.bkjia.com/PHPjc/446178.htmlTechArticle
- We can use PHP to crawl the weather forecast to absolutely streamline the code form method = post input name = a type = text id = a / input type = submit name = Submit value = check / / form ?php $ city...