Posted By

winstonford on 06/22/10


Tagged

domain tld


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

dantreacy
voove
willbolton


Get tld from domain


 / Published in: PHP
 

  1. <?php
  2. $tld = strrchr ( $_SERVER['SERVER_NAME'], "." );
  3. $tld = substr ( $tld, 1 );
  4. echo $tld;
  5. ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: jspicher on February 20, 2013

But what if it's a subdomain?

You need to login to post a comment.