Your Ad Here

 Navigation
Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Blog
Books
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links




 Sponsors
 Links
gambling sites
domain names
wwwstores
 Downloads
 Misc
Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!


Displaying the weather


Displaying the weather

This example will display the weather depending on either what US zip code or city is entered . An improved example would allow the users to enter this information via a form . All of this is freely available at http://www.weather.com .

Code :

<?
//insert a valid US zipcode in here e.g 22222 or you can enter a city
$zipcode = 55555;
//make our url
$url = "http://www.weather.com/weather/local/".$zipcode."?y=16&x=11";
//open the $url for reading
$fp = fopen($url, "r");
$search = fread($fp, 64000);
//close the file handle
fclose($fp);
//our start point and end points , store the rest in $content
$search = ereg("<!-- end svr wx alert -->(.*)<!-- 10 day forecast -->", $search, $content);
//display content
echo "$content[1]";
?>




Books
 Sponsors
 Random Code
hexadecimal to decimal conversion(math)
GD email address(internet)
Slashdot feed(xml)
 Random Article
  Network
Programming resources
Tutorials directory
Hosting resources
ASP site
Domain names
Progged
Maxi directory
bigarticle : free articles
A Code
Code N Tutorials




beginners PHP Copyright © 2004 onwards by beginnersPHP.