array_combine in php example
Example: array_combine function in php
/* Array_combine is inbuilt function in php, which is use to combine two array in key value pair */
/* make sure both array should be of same length */
<?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 )
*/
/*
I hope it will help you.
Namaste
Stay home stay safe
*/