Hi,
I need some help formatting a URL / DOMAIN Address.
when typing in a domain name some people will do this in different ways, like the 4 examples below;
domainname.com www.domainname.com http://domainname.com http://www.domainname.com
I want to be able to have a finished result of "http://www.domainname.com" or "http://domainname.com" so i have one fixed generic result.
Thanks in advance.
<?php
$domain = "http://www.tm-wd.com";
$generic_domain = "http://" . str_replace('http://','',str_replace('www.','',$domain));
echo "$domain --> $generic_domain";
?>