I created the php array for TLD(Top Level Domain) list for country. The array will have country code (ISO 3166-1 alpha-2) as key and TLD as value. I belive it will be useful to someone that they want TLD in PHP array format. Please find the below free download link.
Kinda too long.. How about checking the last part of a domain by using this list: http://data.iana.org/TLD/tlds-alpha-by-domain.txt