Hello Readers ,
Suppose we have two array's .
$fname=array("Peter","Ben","Joe");
$age=array("35","37","43");
The array_combine() function creates an array by using the elements from one "keys" array and one "values" array.
Example :
<?php
$fname=array("Peter","Ben","Joe");
$age=array("35","37","43");
$c=array_combine($fname,$age);
print_r($c);
?>
Output :
Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
0 Comment(s)