PHP array_combine() Function is used to create an array by using one array for keys and another for its values. PHP array_combine() function is PHP built-in function.
Syntax :
array_combine ( array $keys , array $values );
Parameter,
$keys : Required. It is Array of keys.
$values: Required. It is Array of values.
Return : It returns new array by combining keys of array and values of array. It returns false if number of elements for keys of array and values of array is not equal.
If the number of elements in keys and values does not match then it throws E_WARNING.
Let's see below example to understand php array_combine() Function in details.
Comments