Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
【PHP】League\Csvを拡張してCSVファイルの任意のカラムの重複したデータを削除するメソッドを追加
<?php
require_once 'vendor/autoload.php';
use Acme\Csv\Reader;
$str = <<<EOF
john,doe,1
jane,doe,2
foo,bar,3
EOF;
$reader = Reader::createFromString($str);
$result = $reader->fetchDeduplicate(1);
$result = iterator_to_array($result);
print_r($result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment