1/* Array_combine is inbuilt function in php, which is use to combine two array in key value pair */
2/* make sure both array should be of same length */
3
4<?php
5$fname=array("Peter","Ben","Joe");
6$age=array("35","37","43");
7
8$c=array_combine($fname,$age);
9print_r($c);
10?>
11
12/*
13Output:
14Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
15*/
16
17/*
18I hope it will help you.
19Namaste
20Stay home stay safe
21*/