I have $_SERVER[\'HTTP_REFERER\'] — pretend it is http://example.com/i/like/turtles.html. What would I need to do to get just the http://example.com
$_SERVER[\'HTTP_REFERER\']
http://example.com
You should be able to use the parse_url function to achieve that