array_combine()

array_combine() : It is used to create a new array by using the key of one array as keys and using the value of another array as values. The most important thing is using array_combine() that, number of values in both arrays should be same.

$name = array("best","interview","question");
$index = array("1","2","3");
$result = array_combine($name,$index);

array_merge()

array_merge() : It merges one or more than one array such that the value of one array appended at the end of first array and if the arrays have same strings key then the later value overrides the previous value for that key .

$name = array("best","interview","question");
$index = array("1","2","3");
$result = array_merge($name,$index);

BY Best Interview Question ON 07 Apr 2020