I need to build a function which parses the domain from a URL.
So, with
http://google.com/dhasjkdas/sadsdds/sdda/sdads.html
or
function getTrimmedUrl($link) { $str = str_replace(["www.","https://","http://"],[''],$link); $link = explode("/",$str); return strtolower($link[0]); }