$value){ if ($line1[$key] != $line2[$key]) { $number = $key; $ans1 = $line1[$key]; $ans2 = $line2[$key]; } } echo $number."\n".$ans1."\n".$ans2;