..


Sponsored Links

array_combine

The function creates an array by combining other array_combine two arrays. The first array will be used for keys, the second for values. Both arrays must have the same number of elements.

The function in question admits only two parameters that correspond to the two arrays to be merged (the first array provides the keys and the second value).






 $ A1 = array ("a", "b", "c", "d");







 $ A2 = array ("Cat", "Dog", "Mouse", "Cow");







 print_r (array_combine ($ a1, $ a2));



The output of the code above will be:
 



 Array (



  



 [A] => Cat



  



 [B] => Dog



  



 [C] => Rat



  



 [D] => Cow







 )

 

In the same category ...
E-Learning
Linux (Course) Linux (Course)
Complete guide to open-source system. From 49 €.
MySQL (Course) MySQL (Course)
Management of open-source database. From 39 €.
PHP (Course) PHP (Course)
Full course for creating dynamic Web sites. From 49 €.
Sponsored Links