$t = $arr[$n]; $arr[$n] = $arr[$_]; $arr[$_] = $t;