Posted By

ryarwood on 06/13/12


Tagged

wordpress domain host strpos travismathew


Versions (?)

Wordpress Domain Check


 / Published in: PHP
 

  1. <?php
  2. $loc = $_SERVER['REQUEST_URI'];
  3. $locDomain = $_SERVER['HTTP_HOST'];
  4. $posDomain = strpos($locDomain, 'travismathew.ca');
  5. ?>
  6.  
  7. <?php if ($posDomain !== false) { ?>
  8.  
  9. <!-- CANADIAN -->
  10.  
  11. <?php } else { ?>
  12.  
  13. <!-- UNITED STATES -->
  14.  
  15. <?php } ?>

Report this snippet  

You need to login to post a comment.