Not sure I understand the question. Do you need to allow either and, later, return both?
You'll have to be careful, even with a zip/city database that can be purchased, since some cities span multiple zips, so you can't always "calculate" in that direction. Similar issue in the opposite direction.