dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
2
share rss forum feed


Jafo232
You Can't Spell Democrat Without Rat.
Premium
join:2002-10-17
Boonville, NY
reply to JAAulde

Re: PHP: Get TLD from URL

Seems to cause issues when dealing with domains like:

somewhere.co.uk..

Any idea of a work around?



PetePuma
How many lumps do you want
Premium,MVM
join:2002-06-13
Arlington, VA

I can't think of a one-size-fits-all solution that doesn't incorporate a list of all possible TLDs and adjusts accordingly. And even then, it's probably not precise.



JAAulde
Web Developer
Premium,MVM
join:2001-05-09
Williamsport, MD
kudos:3
reply to Jafo232

I forgot an ELSE... look at »codepad.org/NGlABcAC
You can add more logic if you don't want ANY invlaid domains being returned, even when max node count is greater than 0.

But like PetePuma See Profile said, there is no catch all for this. Some of it is going to have to be implementation specific.