I have an array of domain names formatted like this:
preg_match("`(?<=\.)\w+$`", $cc, $tld_array);
Posting here since a comment won't work for this:
php > $cc = 'www.example.com'; php > preg_match("`(?<=\.)\w+$`", $cc, $tld_array); php > print_r($tld_array); Array (  => com )
if this doesn't work for you, make sure that your example.com string doesn't have some non-printable chars hiding in it.