Posted By

fackz on 04/09/09


Tagged

url httpreffer


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

fackz


Gets the main url fo http_reffer


 / Published in: PHP
 

  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  

You need to login to post a comment.