Previous | Home | Next |
array_combine()
The array_combine() function creates an array by using the elements from one "keys" array and one "values" array.
Syntax:array_combine(keys,values);
In above syntax, "keys" are array of keys and "values" are array of values.
Example:
<?php $fruit_name=array("Apple","Banana","Mango"); $fruit_weight=array("5kg","3kg","10kg"); $Total=array_combine($fruit_name,$fruit_weight); print_r($Total); ?>
Output:
Previous | Home | Next |