Finding Duplicate Values in Multi-dimensional Array
问题 I have an array that looks similar to this: Array ( [0] => Array ( [0] => Model2345 [1] => John Doe [2] => SN1234 ) [1] => Array ( [0] => Model2345 [1] => John Doe [2] => SN3456 ) [2] => Array ( [0] => Model1234 [1] => Jane Doe [2] => SN3456 ) ) I want to have a way to check for duplicate values for keys [1] (the John Doe/Jane Doe key) and [2] (the SNxxxx key) in php, but ignore duplicates for key [0]. How can this be accomplished? 回答1: Try this: $array = your_array(); $current = current(