Note: trouble with registration? See this for more info.
0 Members and 1 Guest are viewing this topic.
['; print_r($weather); echo ']'; /* format the result */ function format_result($input) { return strtolower(str_replace(array(' ', '(', ')'), array('-', '-', ''), $input)); } /* helper: does regex */ function get_match($regex,$content) { preg_match($regex,$content,$matches); return $matches[1]; } /* gets the xml data from Alexa */ function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $xml = curl_exec($ch); curl_close($ch); return $xml; } ?>