Zip Code?
timothymarois opened this issue · 4 comments
I've tested the zip code, that doesn't work. I'm not sure if its how this SDK is built or how the API requests, but doesn't seem right to use only city name. (there are many cities that share the same name), I would prefer to query using postal code.
Hi @timothymarois,
thank you for letting me know. Could you please provide some sample code demonstrating the problem? Also, could you elaborate on what you exactly you mean by "that doesn't work"?
Thanks!
Like doing
$weather = $owm->getWeather('28202', 'imperial', 'en');
Doesn't return results. But if I did,
$weather = $owm->getWeather('Charlotte', 'imperial', 'en');
It works. Seems to work on City name only? I figured a postal code would suffice for weather-related data.
I see. Try using zip:28202,US
instead :)
Also see https://github.com/cmfcmf/OpenWeatherMap-PHP-Api/blob/37f2e1178948a07c8d50d5063a15ca84b5b51f6a/Cmfcmf/OpenWeatherMap.php#L182-L186 for all supported formats.
Thank you. that's exactly to be what I am looking for.