Last active
April 3, 2016 03:05
-
-
Save kurozumi/948252ed4eca570e6ca81b4e5c8371e9 to your computer and use it in GitHub Desktop.
【PHP】League\Csvを拡張してCSVファイルの任意のカラムの重複したデータを削除するメソッドを追加
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 | |
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