Gets the main url fo http_reffer


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. // URL:
  3. $site = "http://www.site.com.br/teste";
  4. // SPLITS URL FROM HTTP://:
  5. $url = explode("http://", $site);
  6. // CLEAN THE RESULT , LEAVE THE MAIN ADDRESS:
  7. $site = dirname($url[1].'<br>');
  8. // SHOW:
  9. echo($site);
  10. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.