There are 3 Data items in the array $data[1] = one $data[7] = fred $data[100] = to After the sort $data[0] = to $data[1] = one $data[2] = fred