Month: January 2014

Get domain name from url

$url = trim($url);
$url = preg_replace(“/^(http:\/\/)*(www.)*/is”, “”, $url);
$url = preg_replace(“/\/.*$/is”, “”, $url);
return $url;