Just a quick question... but i have; $ref = $_SERVER['HTTP_REFERER']; Now say the referer is http://www.domain.com/category/page.html or even just http://www.domain.com/page.html. Is there anyway to cut everything off past the .com ? Any help is appreciated..
use parse_url <? $parsed = parse_url( 'http://krakjoe.com/no/pages/here.php' ); echo $parsed['host']; ?> PHP:
You can also explode the url, and put a limit of 4, and 4 will be the text after the domain/ You can use explode to get particular parts out of the url.