PHP Country Codes?

Discussion in 'PHP' started by smashedpumpkins, Mar 7, 2010.

  1. #1
    I'm trying to redirect users based on their county. I found some code that should work out, but I'm not sure how I can find out each countries code. As you can see in the code below different countries use 'AF' and 'BY' etc... Is there a list of the country codes? I'm not worried if users get passed it. The code is for advertising purposes. Thanks

    
    if($TLCC == 'AF'
      || $TLCC == 'BY'
      || $TLCC == 'VE'
      || $TLCC == 'VN')
    {
        header('Location: http://www.examplesite.com');
    }
    PHP:
     
    smashedpumpkins, Mar 7, 2010 IP
  2. fibi

    fibi Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Here you can find this list. http:// xml.coverpages.org/country3166.html
     
    fibi, Mar 7, 2010 IP
  3. fibi

    fibi Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    http:// xml.coverpages.org/country3166.html
     
    fibi, Mar 7, 2010 IP
  4. smashedpumpkins

    smashedpumpkins Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks a ton!
     
    smashedpumpkins, Mar 7, 2010 IP