<?php
$lines = file('data/Indonesia/Suhu Udara Minimum/areal_averaged.csv');
$cols = [1 => 'ssp126', 2 => 'ssp245', 3 => 'ssp370', 4 => 'ssp585'];
$data = [];
foreach($lines as $i => $line) {
    if($i == 0) continue;
    $p = explode(',', trim($line));
    $data[] = $p;
}

$identical = [];
foreach($cols as $i => $name1) {
    foreach($cols as $j => $name2) {
        if($i >= $j) continue;
        $is_identical = true;
        foreach($data as $row) {
            if($row[$i] !== $row[$j]) {
                $is_identical = false;
                break;
            }
        }
        if($is_identical) {
            $identical[] = "$name1 is identical to $name2";
        }
    }
}
if(empty($identical)) {
    echo "NO IDENTICAL LINES\n";
} else {
    echo implode("\n", $identical) . "\n";
}
