Created
November 22, 2017 14:35
-
-
Save spinsch/c14f91d7b7d0cd7454de20db1e3bf55f to your computer and use it in GitHub Desktop.
create a tld list for copy&paste as php array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Content-type: text/plain"); | |
echo "array(\n"; | |
foreach (new NoRewindIterator(new SplFileObject('https://data.iana.org/TLD/tlds-alpha-by-domain.txt')) as $i => $v) { | |
if ($i == 0) {continue;}; | |
echo "\040\040\040\040'".idn_to_utf8(trim(strtolower($v)))."',\n"; | |
} | |
echo ");"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment