<?php
$form_data1 = array(11=>'A',12=>'B',13=>'C',14=>'D');
$form_data2 = array(25=>'B',26=>'A',27=>'D',28=>'C');
$result = array_merge($form_data1, $form_data2);
print_r($result);
?>
输出:
Array
(
[0] => A
[1] => B
[2] => C
[3] => D
[4] => B
[5] => A
[6] => D
[7] => C
)
使用array_merge合并,因为题号(key)是数字,所以键名会重新索引,导致题号不能保留。