Your Ad Here

 Navigation

Home
Source code
Tutorials
RSS feeds
Articles
Books
Software
Downloads
Hosting
manuals
Forums
Script directory
Training
Our Links

 Sponsors
 Links
finance products
dvd information
domain names
 Downloads
 Misc

Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming



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
Server info(functions)

If Else statement(beginner)

backup a folder to a zip file(file system)

 Random Article
  Network

Programming resources
Tutorials directory
General bid directory
sell software, make money
Find me wholesalers
Find me dropshippers
Free recipes online/a>
UK products and price comparison
Anime videos
Free lyrics search
free stuff
UK stores
Gambling directory
Sexy free wallpapers
Hosting resources
ASP site
Golf resources
iPod resources
Coupons and deals
Baby names
Domain names
Dating site
Scripts directory
Maxi directory
bigarticle : free articles
dawgwitch search
List of directories






beginners PHP Copyright © 2004 onwards by beginnersPHP.