Home >Backend Development >PHP Tutorial >PHP array function sequence array_combine() - Instructions for using the array merge function_PHP tutorial
array_combine() Definition and usage
array_combine() function creates a new array by merging two arrays, one of which is the key name, and the value of the other array is the key value.
If one of the arrays is empty, or the two arrays have different numbers of elements, this function returns false.
Syntax
array_combine(array1,array2)
Parameter Description
array1 Required. Specifies the key name.
array2 required. specified value.
Tips and Notes
Note: Both parameters must have the same number of elements.
Example