" . $paramstuff . ""; //exit; $obits=explode("q?query=", $paramstuff); $suffix=""; if (sizeof($obits) > 1) $suffix=explode("&", $obits[1])[0]; $defsuccess=""; $json_string=""; $myselcont=""; if (strpos($paramstuff, "http") !== false) { $keyb=""; $json_string = @file_get_contents($paramstuff); // query using autoip ... thanks to https://apicommunity.wunderground.com/weatherapi/topics/parsing_ambiguous_results_in_php $paramstuff=""; $parsed_json = json_decode($json_string); $i=0; while ($i < sizeof($parsed_json->response->results)) { if ($i == 0) $myselcont=''; $thisurlprefix = $parsed_json->response->results[$i]->l; $myselcont.=''; $i++; } } else if (strpos(('*' . $paramstuff), "*aq") !== false && strpos($paramstuff, "query=") !== false) { $keyb=""; $dkeyb="http://autocomplete.wunderground.com/"; //$json_string = @file_get_contents($dkeyb . $paramstuff); // query using autoip ... thanks to https://apicommunity.wunderground.com/weatherapi/topics/parsing_ambiguous_results_in_php //echo "jstr=" . $json_string; if ($json_string != "") { $paramstuff=""; $parsed_json = json_decode($json_string); $i=0; while ($i < sizeof($parsed_json->response->results)) { if ($i == 0) $myselcont=''; $thisurlprefix = $parsed_json->response->results[$i]->l; $myselcont.=''; $i++; } } } if ($json_string != "") { if ($myselcont != "") { echo " Retrieve Weather Underground data information "; } } else if (strpos(('*' . $paramstuff), "*aq") !== false && strpos($paramstuff, "query=") !== false) { if ($keyb != "") $dkeyb = $keyb . "/"; echo " Retrieve Weather Underground data information "; } else if (strpos($paramstuff, "geolookup") !== false && strpos($paramstuff, "conditions") !== false) { if ($keyb != "") $dkeyb = $keyb . "/"; $defsuccess=" Retrieve Weather Underground data information "; } else { if ($keyb != "") $dkeyb = $keyb . "/"; echo " Retrieve Weather Underground data information "; } if ($defsuccess != "") { echo " Retrieve Weather Underground data information "; } } ?>