Thanks for the reply johanafm, but i think i explained myself wrong 🙁
I'm going to have a database containing the tlds:
#ID TLD
1 .com
2 .co.uk
3 .org.uk
4 .us
5 .me
6 .tv
etc...
Then what i really need is to be able to search the database - I will have a string (a domain) from the user - example: http://www.phpbuilder.com/board/
I will use parse_url to get the domain down to "phpbuilder.com" then using the database of tld - i would like to match the ".com" bit's so i know that the site name is actually just "phpbuilder"
If there were not so many tld's, the way i would think to do it is this:
$site = 'http://www.phpbuilder.com/board/'; // $_get['site'];
$site = parse_url[$site];
$pos = strpos($site, '.com');
echo substr($site, 0, strlen($site)-$pos);
But as there are loads of '.com' '.co.uk' etc -- the above code is not possible.
Thanks for any help again everyone!