strtolower('Andorra'), 'AE' => strtolower('United Arab Emirates'), 'AF' => strtolower('Afghanistan'), 'AG' => strtolower('Antigua and Barbuda'), 'AI' => strtolower('Anguilla'), 'AL' => strtolower('Albania'), 'AM' => strtolower('Armenia'), 'AN' => strtolower('Netherlands Antilles'), 'AO' => strtolower('Angola'), 'AQ' => strtolower('Antarctica'), 'AR' => strtolower('Argentina'), 'AS' => strtolower('American Samoa'), 'AT' => strtolower('Austria'), 'AU' => strtolower('Australia'), 'AW' => strtolower('Aruba'), 'AX' => strtolower('Åland Islands'), 'AZ' => strtolower('Azerbaijan'), 'BA' => strtolower('Bosnia and Herzegovina'), 'BB' => strtolower('Barbados'), 'BD' => strtolower('Bangladesh'), 'BE' => strtolower('Belgium'), 'BF' => strtolower('Burkina Faso'), 'BG' => strtolower('Bulgaria'), 'BH' => strtolower('Bahrain'), 'BI' => strtolower('Burundi'), 'BJ' => strtolower('Benin'), 'BL' => strtolower('Saint Barthélemy'), 'BM' => strtolower('Bermuda'), 'BN' => strtolower('Brunei'), 'BO' => strtolower('Bolivia'), 'BQ' => strtolower('British Antarctic Territory'), 'BR' => strtolower('Brazil'), 'BS' => strtolower('Bahamas'), 'BT' => strtolower('Bhutan'), 'BV' => strtolower('Bouvet Island'), 'BW' => strtolower('Botswana'), 'BY' => strtolower('Belarus'), 'BZ' => strtolower('Belize'), 'CA' => strtolower('Canada'), 'CC' => strtolower('Cocos [Keeling] Islands'), 'CD' => strtolower('Congo - Kinshasa'), 'CF' => strtolower('Central African Republic'), 'CG' => strtolower('Congo - Brazzaville'), 'CH' => strtolower('Switzerland'), 'CI' => strtolower('Côte d’Ivoire'), 'CK' => strtolower('Cook Islands'), 'CL' => strtolower('Chile'), 'CM' => strtolower('Cameroon'), 'CN' => strtolower('China'), 'CO' => strtolower('Colombia'), 'CR' => strtolower('Costa Rica'), 'CS' => strtolower('Serbia and Montenegro'), 'CT' => strtolower('Canton and Enderbury Islands'), 'CU' => strtolower('Cuba'), 'CV' => strtolower('Cape Verde'), 'CX' => strtolower('Christmas Island'), 'CY' => strtolower('Cyprus'), 'CZ' => strtolower('Czech Republic'), 'DD' => strtolower('East Germany'), 'DE' => strtolower('Germany'), 'DJ' => strtolower('Djibouti'), 'DK' => strtolower('Denmark'), 'DM' => strtolower('Dominica'), 'DO' => strtolower('Dominican Republic'), 'DZ' => strtolower('Algeria'), 'EC' => strtolower('Ecuador'), 'EE' => strtolower('Estonia'), 'EG' => strtolower('Egypt'), 'EH' => strtolower('Western Sahara'), 'ER' => strtolower('Eritrea'), 'ES' => strtolower('Spain'), 'ET' => strtolower('Ethiopia'), 'FI' => strtolower('Finland'), 'FJ' => strtolower('Fiji'), 'FK' => strtolower('Falkland Islands'), 'FM' => strtolower('Micronesia'), 'FO' => strtolower('Faroe Islands'), 'FQ' => strtolower('French Southern and Antarctic Territories'), 'FR' => strtolower('France'), 'FX' => strtolower('Metropolitan France'), 'GA' => strtolower('Gabon'), 'GB' => strtolower('United Kingdom'), 'GD' => strtolower('Grenada'), 'GE' => strtolower('Georgia'), 'GF' => strtolower('French Guiana'), 'GG' => strtolower('Guernsey'), 'GH' => strtolower('Ghana'), 'GI' => strtolower('Gibraltar'), 'GL' => strtolower('Greenland'), 'GM' => strtolower('Gambia'), 'GN' => strtolower('Guinea'), 'GP' => strtolower('Guadeloupe'), 'GQ' => strtolower('Equatorial Guinea'), 'GR' => strtolower('Greece'), 'GS' => strtolower('South Georgia and the South Sandwich Islands'), 'GT' => strtolower('Guatemala'), 'GU' => strtolower('Guam'), 'GW' => strtolower('Guinea-Bissau'), 'GY' => strtolower('Guyana'), 'HK' => strtolower('Hong Kong SAR China'), 'HM' => strtolower('Heard Island and McDonald Islands'), 'HN' => strtolower('Honduras'), 'HR' => strtolower('Croatia'), 'HT' => strtolower('Haiti'), 'HU' => strtolower('Hungary'), 'ID' => strtolower('Indonesia'), 'IE' => strtolower('Ireland'), 'IL' => strtolower('Israel'), 'IM' => strtolower('Isle of Man'), 'IN' => strtolower('India'), 'IO' => strtolower('British Indian Ocean Territory'), 'IQ' => strtolower('Iraq'), 'IR' => strtolower('Iran'), 'IS' => strtolower('Iceland'), 'IT' => strtolower('Italy'), 'JE' => strtolower('Jersey'), 'JM' => strtolower('Jamaica'), 'JO' => strtolower('Jordan'), 'JP' => strtolower('Japan'), 'JT' => strtolower('Johnston Island'), 'KE' => strtolower('Kenya'), 'KG' => strtolower('Kyrgyzstan'), 'KH' => strtolower('Cambodia'), 'KI' => strtolower('Kiribati'), 'KM' => strtolower('Comoros'), 'KN' => strtolower('Saint Kitts and Nevis'), 'KP' => strtolower('North Korea'), 'KR' => strtolower('South Korea'), 'KW' => strtolower('Kuwait'), 'KY' => strtolower('Cayman Islands'), 'KZ' => strtolower('Kazakhstan'), 'LA' => strtolower('Laos'), 'LB' => strtolower('Lebanon'), 'LC' => strtolower('Saint Lucia'), 'LI' => strtolower('Liechtenstein'), 'LK' => strtolower('Sri Lanka'), 'LR' => strtolower('Liberia'), 'LS' => strtolower('Lesotho'), 'LT' => strtolower('Lithuania'), 'LU' => strtolower('Luxembourg'), 'LV' => strtolower('Latvia'), 'LY' => strtolower('Libya'), 'MA' => strtolower('Morocco'), 'MC' => strtolower('Monaco'), 'MD' => strtolower('Moldova'), 'ME' => strtolower('Montenegro'), 'MF' => strtolower('Saint Martin'), 'MG' => strtolower('Madagascar'), 'MH' => strtolower('Marshall Islands'), 'MI' => strtolower('Midway Islands'), 'MK' => strtolower('Macedonia'), 'ML' => strtolower('Mali'), 'MM' => strtolower('Myanmar [Burma]'), 'MN' => strtolower('Mongolia'), 'MO' => strtolower('Macau SAR China'), 'MP' => strtolower('Northern Mariana Islands'), 'MQ' => strtolower('Martinique'), 'MR' => strtolower('Mauritania'), 'MS' => strtolower('Montserrat'), 'MT' => strtolower('Malta'), 'MU' => strtolower('Mauritius'), 'MV' => strtolower('Maldives'), 'MW' => strtolower('Malawi'), 'MX' => strtolower('Mexico'), 'MY' => strtolower('Malaysia'), 'MZ' => strtolower('Mozambique'), 'NA' => strtolower('Namibia'), 'NC' => strtolower('New Caledonia'), 'NE' => strtolower('Niger'), 'NF' => strtolower('Norfolk Island'), 'NG' => strtolower('Nigeria'), 'NI' => strtolower('Nicaragua'), 'NL' => strtolower('Netherlands'), 'NO' => strtolower('Norway'), 'NP' => strtolower('Nepal'), 'NQ' => strtolower('Dronning Maud Land'), 'NR' => strtolower('Nauru'), 'NT' => strtolower('Neutral Zone'), 'NU' => strtolower('Niue'), 'NZ' => strtolower('New Zealand'), 'OM' => strtolower('Oman'), 'PA' => strtolower('Panama'), 'PC' => strtolower('Pacific Islands Trust Territory'), 'PE' => strtolower('Peru'), 'PF' => strtolower('French Polynesia'), 'PG' => strtolower('Papua New Guinea'), 'PH' => strtolower('Philippines'), 'PK' => strtolower('Pakistan'), 'PL' => strtolower('Poland'), 'PM' => strtolower('Saint Pierre and Miquelon'), 'PN' => strtolower('Pitcairn Islands'), 'PR' => strtolower('Puerto Rico'), 'PS' => strtolower('Palestinian Territories'), 'PT' => strtolower('Portugal'), 'PU' => strtolower('U.S. Miscellaneous Pacific Islands'), 'PW' => strtolower('Palau'), 'PY' => strtolower('Paraguay'), 'PZ' => strtolower('Panama Canal Zone'), 'QA' => strtolower('Qatar'), 'RE' => strtolower('Réunion'), 'RO' => strtolower('Romania'), 'RS' => strtolower('Serbia'), 'RU' => strtolower('Russia'), 'RW' => strtolower('Rwanda'), 'SA' => strtolower('Saudi Arabia'), 'SB' => strtolower('Solomon Islands'), 'SC' => strtolower('Seychelles'), 'SD' => strtolower('Sudan'), 'SE' => strtolower('Sweden'), 'SG' => strtolower('Singapore'), 'SH' => strtolower('Saint Helena'), 'SI' => strtolower('Slovenia'), 'SJ' => strtolower('Svalbard and Jan Mayen'), 'SK' => strtolower('Slovakia'), 'SL' => strtolower('Sierra Leone'), 'SM' => strtolower('San Marino'), 'SN' => strtolower('Senegal'), 'SO' => strtolower('Somalia'), 'SR' => strtolower('Suriname'), 'ST' => strtolower('São Tomé and Príncipe'), 'SU' => strtolower('Union of Soviet Socialist Republics'), 'SV' => strtolower('El Salvador'), 'SY' => strtolower('Syria'), 'SZ' => strtolower('Swaziland'), 'TC' => strtolower('Turks and Caicos Islands'), 'TD' => strtolower('Chad'), 'TF' => strtolower('French Southern Territories'), 'TG' => strtolower('Togo'), 'TH' => strtolower('Thailand'), 'TJ' => strtolower('Tajikistan'), 'TK' => strtolower('Tokelau'), 'TL' => strtolower('Timor-Leste'), 'TM' => strtolower('Turkmenistan'), 'TN' => strtolower('Tunisia'), 'TO' => strtolower('Tonga'), 'TR' => strtolower('Turkey'), 'TT' => strtolower('Trinidad and Tobago'), 'TV' => strtolower('Tuvalu'), 'TW' => strtolower('Taiwan'), 'TZ' => strtolower('Tanzania'), 'UA' => strtolower('Ukraine'), 'UG' => strtolower('Uganda'), 'UM' => strtolower('U.S. Minor Outlying Islands'), 'US' => strtolower('United States'), 'UY' => strtolower('Uruguay'), 'UZ' => strtolower('Uzbekistan'), 'VA' => strtolower('Vatican City'), 'VC' => strtolower('Saint Vincent and the Grenadines'), 'VD' => strtolower('North Vietnam'), 'VE' => strtolower('Venezuela'), 'VG' => strtolower('British Virgin Islands'), 'VI' => strtolower('U.S. Virgin Islands'), 'VN' => strtolower('Vietnam'), 'VU' => strtolower('Vanuatu'), 'WF' => strtolower('Wallis and Futuna'), 'WK' => strtolower('Wake Island'), 'WS' => strtolower('Samoa'), 'YD' => strtolower("People's Democratic Republic of Yemen"), 'YE' => strtolower('Yemen'), 'YT' => strtolower('Mayotte'), 'ZA' => strtolower('South Africa'), 'ZM' => strtolower('Zambia'), 'ZW' => strtolower('Zimbabwe'), 'ZZ' => strtolower('Unknown or Invalid Region'), ); $ans = ""; $place = ""; $country = ""; $sqs = ""; $cr = ""; $cc = ""; if (isset($_GET['CityName']) && isset($_GET['CountryName'])) { $place = $_GET['CityName']; $country = $_GET['CountryName']; $sqs = $_SERVER['QUERY_STRING']; if (1 == 1) { if ($country == '') { echo ' function weatherfor() { var citycountry="' . $place . ' weather"; window.open("https://www.google.com.au/search?q=" + encodeURIComponent(citycountry) + "&client=firefox-a&rls=org.mozilla:en-US:official&source=lnms&sa=X&ei=de-XUrCELIXSkwXL9ICIDg&ved=0CAgQ_AUoAA&biw=1243&bih=609&dpr=1#q=" + encodeURIComponent(citycountry) + "+weather", "_blank", "top=200,height=200,width=400,height=400"); } '; } else { echo ' function weatherfor() { var citycountry="' . $place . "," . $country . ' weather"; window.open("https://www.google.com.au/search?q=" + encodeURIComponent(citycountry) + "&client=firefox-a&rls=org.mozilla:en-US:official&source=lnms&sa=X&ei=de-XUrCELIXSkwXL9ICIDg&ved=0CAgQ_AUoAA&biw=1243&bih=609&dpr=1#q=" + encodeURIComponent(citycountry) + "+weather", "_blank", "top=200,height=200,width=400,height=400"); } '; } exit; } } else if (isset($_GET['place']) && isset($_GET['country'])) { $cr = "\n"; $place = $_GET['place']; $country = $_GET['country']; $sqs = "CityName=" . $place . "&CountryName=" . $country; if (1 == 1) { if ($country == '') { echo ' function weatherfor() { var citycountry="' . $place . ' weather"; window.open("https://www.google.com.au/search?q=" + encodeURIComponent(citycountry) + "&client=firefox-a&rls=org.mozilla:en-US:official&source=lnms&sa=X&ei=de-XUrCELIXSkwXL9ICIDg&ved=0CAgQ_AUoAA&biw=1243&bih=609&dpr=1#q=" + encodeURIComponent(citycountry) + "+weather", "_blank", "top=200,height=200,width=400,height=400"); } '; } else { echo ' function weatherfor() { var citycountry="' . $place . "," . $country . ' weather"; window.open("https://www.google.com.au/search?q=" + encodeURIComponent(citycountry) + "&client=firefox-a&rls=org.mozilla:en-US:official&source=lnms&sa=X&ei=de-XUrCELIXSkwXL9ICIDg&ved=0CAgQ_AUoAA&biw=1243&bih=609&dpr=1#q=" + encodeURIComponent(citycountry) + "+weather", "_blank", "top=200,height=200,width=400,height=400"); } '; } exit; } } $cc = array_search(strtolower($country), $acc); $nexturl = "./get_weather.php?" . $sqs; if ($sqs != "") { //exec("curl " . "http://www.webservicex.net/globalweather.asmx/GetWeather?" . $_SERVER['QUERY_STRING'] . " > " . dirname(__FILE__) . "/weather.xml"); //$ans = file_get_contents(dirname(__FILE__) . "/weather.xml"); //echo $ans; if (1 == 1) { //file_put_contents("xxx.xxx", "http://openweathermap.org/find?" . str_replace("CityName=","q=",str_replace("&CountryName=",",",$sqs))); //$ans=""; //http://www.worldweatheronline.com/CHITTAGONG-weather/BD.ASPX if (isset($_GET['State'])) { $ans = file_get_contents(str_replace(" ","-","http://www.worldweatheronline.com/" . str_replace("CityName=","",str_replace("&CountryName=","-weather/" . str_replace("*", "", str_replace("*/", "", str_replace(" ", "-", ("*" . $_GET['State'] . "/")))) . strtoupper($cc) . ".aspx?junk=",$sqs)))); } else { $ans = file_get_contents(str_replace(" ","-","http://www.worldweatheronline.com/" . str_replace("CityName=","",str_replace("&CountryName=","-weather/" . strtoupper($cc) . ".aspx?junk=",$sqs)))); } //$ans = "http://www.worldweatheronline.com/" . str_replace("CityName=","",str_replace("&CountryName=","-weather/" . strtoupper($cc) . ".aspx?junk=",$sqs)); $poszero = strpos($ans, "Unexpected Error"); $pos1 = strpos($ans, "

Latest Weather Observations

"); if ($pos1 !== false) { $ans1 = substr($ans, $pos1); $pos2 = strpos($ans1, ""); if ($pos2 !== false) { $ans = str_replace("", "", str_replace("", "", str_replace("Latest Weather", ">" . $place . ", " . $country . " Latest Weather", substr($ans1, 0, ($pos2 + 4))))))); } } else if ($poszero !== false) { file_put_contents(dirname(__FILE__) . "/get_the_weather.html", "<" . "script> function ask(inb) { var nurl=prompt('Enter your State/Territory Name (in full) associated with " . $place . ", " . $country . "',''); location.href=inb + '&State=' + nurl.replace(' ', '-'); } "); header("Location: ./get_the_weather.html"); exit(); } } else { $ans = file_get_contents("http://www.webservicex.net/globalweather.asmx/GetWeather?" . $sqs); $ans2 = str_replace('<' . '/string>','',str_replace('<' . '?xml version="1.0" encoding="utf-16"?>','',str_replace("<","<",str_replace(">",">",$ans)))); $ans = str_replace('<' . '?xml version="1.0" encoding="utf-8"?>','',str_replace('<' . 'Status>Success','',$ans2)); $ans2 = str_replace('<' . 'CurrentWeather>','',str_replace('','',$ans)); $ans = str_replace('<' . 'CurrentWeather>','',str_replace('','',$ans2)); $ans2 = str_replace('','',str_replace('','',str_replace('','',str_replace('','',str_replace('','',str_replace('','',str_replace('','',str_replace('','',str_replace('','',$ans))))))))); for ($jj=0; $jj<15; $jj++) { $ans = str_replace(">",": ",str_replace("<",$cr,$ans2)); $ans2 = $ans; } } echo str_replace("\n","
",$ans); exit(0); } ?> Get the Weather via Global Weather ... http://www.webservicex.net/ ... thanks'; ?>

Hover (or Click) for weather from GlobalWeather

Parameter Value
CityName:
CountryName:


' . $ans . ''; ?>