There is a multidimensional array:
Array ( [0] => Array ( [0] => msi [1] => im [2] => rec [3] => orig_tor ) [1] => Array ( [0] => 911 [1] => 2150 [2] => 10 [3] => 7 ) ) You need to change the array key (rename, in fact, swap) array[0][1] to array[0][2] and array[0][2] to array[0][1] and so on for each nested array for keys [1] and [2].