$array = [];
//$table_data is mysql returned array, you can change this whatever you want
foreach($table_data as $row) {
$key = $row['type'] . '-' . $row['year'];
if (!isset($array[$key])) {
$array[$key] = $row;
}
}
Try with this , i think this is correct solution for your issue.