Distinguish array functions

array_combine和array_merge:

array_combine only for combining two arrays, wherein the first array as a key value of the new array, the second array value as the value of the new array.

array_merge may be used to combine multiple arrays, if there are two identical keys, key called the key name corresponding to the last key value (the value of the latter overwrite the previous value). If the array is numerically indexed, the name would have been in a continuous manner is key to re-index.

array+array和array_merge:

If the key character is named array_merge, and the same key name, array_merge () array element value behind overwrite the previous array element value

If the key character is named array_array, and the same keys, adding an array of values ​​will first appear as a result of

If the key named array_merge digital, array_merge () will not be covered

If the key array + array called number, adding the value of the array will first appear as a result, the key behind the same name will be discarded

 

Guess you like

Origin www.cnblogs.com/hanmengya/p/11404647.html