PHP code example of arm-band / php-tsv-parser-garbutt
1. Go to this page and download the library: Download arm-band/php-tsv-parser-garbutt library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
arm-band / php-tsv-parser-garbutt example snippets
use PhpTsvParserGarbutt\PhpTsvParserGarbutt;
/**
* PhpTsvParserGarbutt
*
* @param string $filepath : (* @param string $linefeed : Assumed string of linefeed.
* @param string $separator : Assumed string of separator.
* @param string $charset_from : Character sets before conversion.
* @param string $charset_to : Character sets after conversion.
*/
$appInstance = new PhpTsvParserGarbutt(__DIR__ . '/data/testdata.tsv', 7);
/* testdata.tsv
0001 Townsville Airport Garbutt Airport TSV オーストラリア AU https://www.townsvilleairport.com.au
0002 Tokyo International Airport 東京国際空港 HND 日本 JP https://tokyo-haneda.com
0003 Aeroporto Internacional Aristides Pereira アリスティデス・ペレイラ国際空港 BVC カーボベルデ CV http://www.infraero.gov.br/index.php/br/situacao-dos-voos/por-aeroporto.html
*/
// fileread
$parsedData = $appInstance->read();