86400 || !file_exists($tldsfp)) {// if more than 1 day has passed since last list dl or list file can't be found $url='https://data.iana.org/TLD/tlds-alpha-by-domain.txt'; $buf=@file_get_contents($url); if ($buf===false) echo "gettlds: could not download «{$url}»\n"; elseif (@file_put_contents($tldsfp,$buf)===false) echo "gettlds: could not save «{$tldsfp}»\n"; elseif (@file_put_contents($ldlfp,$now."\n")===false) echo "gettlds: could not save «{$ldlfp}»\n"; } if (!isset($buf)) $buf=@file_get_contents($tldsfp); if ($buf!==false) { $tlds=[]; $buf=explode("\n",$buf); foreach ($buf as $val) if (trim($val)!=='' && $val[0]!='#') $tlds[]=$val; rsort($tlds); foreach ($tlds as $key=>$val) $tlds[$key]=strtolower($val); } return $tlds; } ?>