I have a variable called $domain, that should contain http://www.domainname.com
etc, but I need to strip out the http://www
. etc to leave me with domainname.com,
but it also needs to be fairly flexible as sometimes the variable may only contain www.domainname.com
etc, or could even already store domainname.com or even have
spelling errors in the beginning as its human entered, i.e. htp:/ww.domainname.com etc, but I still need to strip out that domainname.com so the $domain variable equals that regardless. Also some domains come as domainname.co.uk so will need to take account of this incase it strips the wrong stuff out !