Blogger Information
Blog 142
fans 5
comment 0
visits 130214
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
使用array_merge合并两部分答案
php开发大牛
Original
630 people have browsed it

<?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)是数字,所以键名会重新索引,导致题号不能保留。


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post