Created
August 17, 2020 01:43
-
-
Save kastaneda/4bca366b3da122f61ba3944e4bbeb448 to your computer and use it in GitHub Desktop.
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 | |
$tsv = "foo\t100\t150\nbar\t120\t200\nquux\t115\t180\n"; | |
echo $tsv; | |
$table = array_map(fn($row) => explode("\t", $row), explode("\n", trim($tsv))); | |
print_r($table); | |
echo implode("\n", array_map(fn($row) => implode("\t", $row), $table)) . "\n"; |
Author
kastaneda
commented
Aug 17, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment