Your Ad Here

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




 Sponsors
 Links
domain names
dvd information
wwwstores
 Downloads
dzphp editor
EasyPHP
mysql_phpgenerator
php-studio-trial
phpdesigner_7_2_5
phpMyAdmin-3.4.3.2
/phptriad2-2-1
phpxedit_321
rapidphp 2011
WampServer2.1d-x64
WampServer2.1e-x32
xampp-win32-1.7.4-VC6-installer
xampplite-win32-1.7.3
 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
create a jpeg(image)
World population(internet)
Create a PDF(utilities)
 Random Article
  Network
Programming resources
Tutorials directory
Hosting resources
ASP site
Domain names
Progged
Maxi directory
bigarticle : free articles
A Code
Code N Tutorials
Get PHP
Programmers help




beginners PHP Copyright © 2004 onwards by beginnersPHP.