Closed Thread
Results 1 to 2 of 2

Thread: What will be validation for Zip code ?

  1. #1
    eluminoustech is offline Newbie
    Join Date
    Jun 2009
    Posts
    4
    Rep Power
    0

    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. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest

    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

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Registration Validation...
    By GerarD_91 in forum PHP Development
    Replies: 6
    Last Post: 03-31-2011, 12:48 AM
  2. Validation help
    By movax85 in forum General Programming
    Replies: 7
    Last Post: 03-23-2011, 05:49 AM
  3. PHP Validation
    By Alex_j in forum PHP Development
    Replies: 3
    Last Post: 04-27-2010, 08:51 AM
  4. W3c Validation request
    By deafjoomla in forum easyContact
    Replies: 1
    Last Post: 08-10-2007, 06:10 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts