Difference between array_combine and array_merge?



Difference between array_combine and array_merge?..

Answer / Rohit Sachan

In PHP, 'array_merge' combines multiple arrays into one multidimensional array, preserving the keys of the original arrays when there are duplicates. 'array_combine', on the other hand, takes two arrays as arguments and creates a new indexed array where each key from the first argument corresponds to its corresponding value in the second argument.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

how will i set pagination ?

2 Answers  


What is the differences between $a != $B and $a !== $B?

1 Answers  


which function used to get the number of days between two given dates in php

1 Answers  


What is $globals php?

1 Answers  


how to open & closing opening period in fico

1 Answers   NS,


Explain soundex() and metaphone().

1 Answers  


Which method removes the last element from the end of an array?

1 Answers  


What is the difference between myisam and innodb?

1 Answers  


What is the use of trim function in php?

1 Answers  


How to create a table using php?

1 Answers  


How to write a program to make chess?

1 Answers  


How to insert a line break in php string?

1 Answers  


Categories