How can I shorten a zip code to its first 3 digits?
Posted on 2012-03-10
I'm allowing a user to search my db by using a zip code to find merchants in that zip code.
But I also want to show results of zip codes nearby based on the 5 digit zip code entered.
Shortening the zip code to 4 digits will give me the results I want. I'll also want to expand that search to a much broader area using the same input by shortening that input to 3 digits.
So what do I write after the following:
Thanks for the help,