FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Zip Codes ctype? Pregmatch?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Zip Codes ctype? Pregmatch? [message #182737 is a reply to message #182721] Sun, 01 September 2013 00:07 Go to previous message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma:
Senior Member
On 2013-08-31 2:17 AM, Gordon Burditt wrote:
>> I'm attempting to check for US and Canadian zip codes (postal codes).
>
> For what purpose? The reason I ask is that the type of checking you
> do may depend on the reason for the checking.

While I certainly appreciate all the data you posted, I'm aware of most
of it, not all, and my eventual course, which I'm getting around to now,
is to use their API to determine valid codes (or not).

My "real" reason? Well, I've accomplished what I've set out to do for
now and the next step is using APIs where they exist; supply a
zip/postal code and get a response for whether it's valid or not.

>
....

maybe you need to review what it is you're trying to
> accomplish.
>

My goal is to learn, and what I've learned from tis thread is a great
deal about using PHP to handle these matters for postal codes and many
other similar formats that have nothing to do with postal codes. I
believe I have picked up a good deal of the information/experience I
need now, and am better off for it.

....

>
> The Standard and Unique ZIP codes are valid for most purposes.

Agreed.
>
....
>
> A ZIP code may change. I was in 2 zip code splits near Houston,
> Texas around Feb. 1976 where the apartment I moved out of and the
> house I moved into both changed (5-digit) ZIP codes. 9-digit
> codes hadn't been put to use yet.

Which is the draw to using their automated lookups to determine the
validity or not; it's my current bent.

>

....
>
> On the other hand, if your requirements are to (1) eliminate as
> many bad codes as possible, and (2) a database subscription to
> issued codes is acceptable, and (3) an occasional rejection of brand
> new codes is acceptable, then you want to find an API preferably
> maintained by someone else to do the checking for you.

They're freely available for the US and Canada; I've used them manually
and they accomplish my goals for me. I'm very hungry for information
from the learning PHP POV and this has been an excellent thread to that
end. One of the better things is having learned ctype_ ... something
I've never used successfully before and now find it an easy thing to
handle.

Again, thanks for all that information; I appreciate a post like this
and don't mind saying so.

Regards,

Twayne`
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Where's the error?
Next Topic: Xml Loading special Characters
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 08:31:55 GMT 2024

Total time taken to generate the page: 0.04859 seconds