+ Reply to Thread
Results 1 to 2 of 2

Thread: What will be validation for Zip code ?

  1. #1
    Newbie eluminoustech is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    4

    Smile What will be validation for Zip code ?

    Hello Friends,
    Here is a post for Zip code Validation

    Zip code : Zip code should be atleast 3 & atmost 10 charcters only , should be alphanumeric & should accept dash(-).

    Golden Regards,
    Eluminous Support Team
    eLuminous Technologies

  2. #2
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,751
    Blog Entries
    97

    Re: What will be validation for Zip code ?

    Here is a regular expression to match 12342-1234 or just 12342 in PHP:
    Code:
    /^([0-9]{5})(-[0-9]{4})?$/i
    To determine if a valid zip code exists:

    Code:
    if(preg_match("/^([0-9]{5})(-[0-9]{4})?$/i",$zip_code)) {
        
    // Match

    From: USA's Zip Code Validation in PHP

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 0
    Last Post: 02-22-2009, 08:40 AM