#original (for the 1st column): $y = 0; for ($x = 0; $x < 15; $x++) { push @newips, $ips[$x][$y]; } #new code, gets the second column $y = 1; for ($x = 0; $x < 15; $x++) { push @num, $ips[$x][$y]; } #### for ($x = 0; $x < 15; $x++) { push @newips, $ips[$x][0]; push @num, $ips[$x][1]; }