Read web pages

This is a script the allow you to read a webpage into a buffer

<?php
	//7 DAY WEATHER FORECAST....
	$curl_handle=curl_init();
	curl_setopt($curl_handle,CURLOPT_URL,'http://www.southafricanweather.co.za/aat/default.asp?area=77026');
	curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
	$buffer = curl_exec($curl_handle);
	curl_close($curl_handle);
 
	$weatherStart = strstr($buffer, "RoundCorBox");
	$weatherStart = strstr($weatherStart, "<table>");
	$weatherEnd = strpos($weatherStart, "</table>");
	$weather = substr($weatherStart, 0, $weatherEnd);
	$weather = str_replace("images/weather_icons_small/", "http://www.southafricanweather.co.za/aat/images/weather_icons_small/", $weather);
 
	$html .= $weather."</table>\n\t\t\t";
	print_r($html);
?>
 
/home/dodgydevil/wiki.zendfusion.com/data/pages/scripts/php/php_scripts.txt · Last modified: 2009/08/19 06:21 by bosbaba
[unknown button type]
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
Zend Fusion