Created
February 15, 2017 17:09
-
-
Save jbnv/b93b2c69b85a9346a8638bd9f518a5b3 to your computer and use it in GitHub Desktop.
Convert various list formats to arrays.
This file contains hidden or 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
$csv = <<<CONTENT | |
... | |
CONTENT; | |
$outbound = array(); | |
foreach(explode("\n",$tsv) AS $line) { | |
$a = explode(",",$line); | |
$outbound[$a[0]] = $a[1]; | |
} |
This file contains hidden or 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
$tsv = <<<TSV | |
... | |
TSV; | |
$outbound = array(); | |
foreach(explode("\n",$tsv) AS $line) { | |
$a = explode("\t",$line); | |
$outbound[$a[0]] = $a[1]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment