dslreports logo
 
    All Forums Hot Topics Gallery
spc
uniqs
15

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

Jafo232 to JAAulde

Premium Member

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
MVM
join:2002-06-13
Arlington, VA

PetePuma

MVM

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
MVM
join:2001-05-09
Frederick, MD
ARRIS SB6141
Ubiquiti EdgeRouter Lite
Ubiquiti UniFi AP

JAAulde to Jafo232

MVM

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.