Skip to content

Instantly share code, notes, and snippets.

@fordnox
Created April 10, 2013 07:21
Show Gist options
  • Save fordnox/5352502 to your computer and use it in GitHub Desktop.
Save fordnox/5352502 to your computer and use it in GitHub Desktop.
Get array of all second-level-domains
<?php
$CsvString = file_get_contents('https://raw.github.com/gavingmiller/second-level-domains/master/SLDs.csv');
$Data = str_getcsv($CsvString, PHP_EOL);
foreach($Data as &$Row) {
list($tld, $stld) = str_getcsv($Row, ",");
$Row = $stld;
}
var_export($Data, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment