One approach may be faster than another based on how many stores you have. Unless you have as many locations as McDonalds the second option is probably faster.
Either way you're going to have to compute the distance between 2 points of latitude/longitude which is not an easy formula to derive because of the curvature of the earth. However it has already been derived by many other people. Follow this link for details of how to perform that computation.
The basic algorithm above can be very slow because it involves computing many distances. However, it can be optimized significantly for actual implementation. It does however start you off on the right track.
In reply to RE: Searching by zip code
by lhoward
in thread Searching by zip code
by funkwater
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |