Array_merge is a key that discards the original number, retains a key in the form of a string, and then forms a new array, regardless of whether the key name is the same or not, unless the key name and value are the same and must be a key in the form of a string to merge. And Array+array is no matter what you are, it will only first put the previous array of data into the newly generated array, and then see whether the second array is more than the first array, more than the number of added, it is only a few numbers, but this case it will be added: $a = array (' d ' = ' aass ', ' e ' = ' adsdfd ', ' asd ' = ' asdsdd ', ' ddfg ' = ' dssdf ');
Copy CodeThe code is as follows:
$b = Array (' d ' = ' adddd ', ' adsdfd ', ' asdfsddddd ', ' d ' = ' aass ');
$d = $a + $b;
$e = Array_merge ($a, $b);
Var_dump ($d);
Var_dump ($e);
Print:
Array
' d ' = = String ' Aass ' (length=4)
' E ' = = String ' ADSDFD ' (length=6)
' ASD ' = String ' ASDSDD ' (length=6)
' DDFG ' = String ' dssdf ' (length=5)
0 = String ' adsdfd ' (length=6)
1 = String ' asdfsddddd ' (length=10)
Array
' d ' = = String ' Aass ' (length=4)
' E ' = = String ' ADSDFD ' (length=6)
' ASD ' = String ' ASDSDD ' (length=6)
' DDFG ' = String ' dssdf ' (length=5)
0 = String ' adsdfd ' (length=6)
1 = String ' asdfsddddd ' (length=10)
http://www.bkjia.com/PHPjc/327779.html www.bkjia.com true http://www.bkjia.com/PHPjc/327779.html techarticle Array_merge is a key that discards the original number, retains a key in the form of a string, and then forms a new array, regardless of whether the key name is the same, unless the key name and value are the same ...