I am want to know how a regular expression to get the com or co.uk in a domain name
$domain = abcde.co.uk;
$domain2 = abcde.com
$tdl = preg_replace('/^.*.([^.]+)$/D', '$1', $domain);
echo $tdl;
$tdl2 = preg_replace('/^.*.([^.]+)$/D', '$1', $domain);
echo $tdl2;
it works in the second but not the first.