Different text displayed if domain extension is .com instead of .se?

Discussion in 'PHP' started by Anveto, Sep 22, 2010.

  1. #1
    Is there a way to use php to display different text if the domain extension for viewing the same file is the same. like mydomain.com and mydomain.se is pointing to the same file but I want different text to display on each one.
     
    Anveto, Sep 22, 2010 IP
  2. jaholden

    jaholden Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Something like:

    <?php if(preg_match('/\.se$/', $_SERVER['HTTP_HOST'])) { ?>
    
    Text for Swedish
    
    <?php } else { ?>
    
    Text for everywhere else
    
    <?php } ?>
    PHP:
     
    jaholden, Sep 23, 2010 IP