function lower($str){ return strtolower($str); } function convert($str){ $str=str_replace(" ","_",$str); return $str; } function revert($str){ $str=str_replace("_"," ",$str); return $str; } function RemoveExtSpaces($str){ while (sizeof ($array=explode (" ",$str)) != 1){ // use one space for the glue $str = implode (" ",$array); } return trim($str); } //$str=" Hello mr boy go "; //$str_ch=RemoveExtSpaces($str); //echo convert($str_ch); function getWeather($city) { echo $requestAddress = "http://www.google.com/ig/api?weather=".str_replace("-", " ", $city)."&hl=en"; // Downloads weather data based on location - I used my zip code. $xml_str = @file_get_contents($requestAddress,0); // Parses XML $xml = new SimplexmlElement($xml_str); // Loops XML $count = 0; if(isset($xml)){ foreach($xml->weather as $item) { foreach($item->forecast_conditions as $new) { ?>