Use strrpos() to locate the last . and then use substr() to trim 
everything else away.

        php.net is your friend. :)


*********** REPLY SEPARATOR  ***********

On 26/01/2009 at 9:20 p.m. Michael wrote:

>What I need to do is grab the TLD from a URL string-
>eg: www.networkstuff.co.nz - what I want returned is the 'nz' part.
>What is the best way to achieve this?
>Thanks in anticipation. 




---
Karl
Senior Account Manager
www.KIWIreviews.co.nz ... Where Your Views Count
Please consider the environment before printing this email.



--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to