php get domain from url
snippet in php

php get domain from url

user5753

$url = 'http://google.com/dhasjkdas/sadsdds/sdda/sdads.html';
$parse = parse_url($url);
echo $parse['host']; // prints 'google.com'

php get domain name from url

user6100

parse_url('http://www.website.com/hey.php', PHP_URL_HOST);