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 number of elements in the two arrays is different, 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
Copy code The code is as follows:
$a1=array("a","b","c","d");
$a2=array(" Cat","Dog","Horse","Cow");
print_r(array_combine($a1,$a2));
?>
The above introduces the cosmic wonder php array function sequence array_combine - the instructions for the use of the array merging function, including the content of cosmic wonder. I hope it will be helpful to friends who are interested in PHP tutorials.