<?php $csv = <<<CSV id: 10, location: Canada, people: 12 id: 10, location: United States, people: 15 id: 15, location: England, people: 19 id: 16, location: India, people: 20 id: 16, location: Germany, people: 9 CSV; foreach (explode(PHP_EOL, $csv) as $line) { $firstColumn = strtok($line, ','); if (!isset($lookup[$firstColumn])) { echo $line . PHP_EOL; $lookup[$firstColumn] = true; } }
You have javascript disabled. You will not be able to edit any code.