Suganya Rajasekar Suganya Rajasekar - 1 year ago 61
PHP Question

Combine two array values to make them key=>value format

I am having two arrays like this

[0] => username
[1] => avatar
[0] => name
[1] => 4.jpg

Here, I need to get these values in the following format


i.e., merge the same key values in the above format..

How should I do this,..Someone help me..

If you think that my title is wrong,Please change it into correct format.


Answer Source

use $c = array_combine($a, $b);

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download