Hello .. i wanna know if i have this link for example .. http://www.yahoo.com/games/something-here and i want only to show yahoo.com from this url ,, how can i do this ? any idea ? Thank you
$string= $_SERVER["REQUEST_URI"]; //here you define the desired string you would like to check $parsed = parse_url ( $string ); $uri .= isset($parsed['host']) ? $parsed['host'] : ''; echo $uri;?> PHP: At localhost it prints localhost.