$url = trim($url);
$url = preg_replace(“/^(http:\/\/)*(www.)*/is”, “”, $url);
$url = preg_replace(“/\/.*$/is”, “”, $url);
return $url;
2 thoughts on “Get domain name from url”
Leave your comment
You must be logged in to post a comment.
Creative, Informative and Entertaining Stuff for everyone
$url = trim($url);
$url = preg_replace(“/^(http:\/\/)*(www.)*/is”, “”, $url);
$url = preg_replace(“/\/.*$/is”, “”, $url);
return $url;
You must be logged in to post a comment.
Hello Vinodkram
visit vinodkram.com for more