<?php $lookup = [ ['a', 'ape'], ['b', 'bee'], ['a', 'ant'], ['d', 'dog'], ['b', 'bat'], ['a', 'asp'], ]; function getValueAt($lookup, $rowIndex, $columnIndex) { return $lookup[$rowIndex][$columnIndex]; } $columnIndex = 0; $values = []; for ($i = 0; $i < count($lookup); ++$i) { $values[getValueAt($lookup, $i, $columnIndex)][] = $i; } var_export($values); echo "\n"; $onlyRecurringRows = array_filter($values, fn($row) => count($row) > 1); var_export($onlyRecurringRows);
You have javascript disabled. You will not be able to edit any code.