0

Hi Friends!

Can you people help me out about this

I have Two Array's

1:
a[]
=>1
=>3
=>4

2:
b[]
=>5
=>6
=>8

and I want to combine both array like this

c[1]=5
c[3]=6
c[4]=8


Means the value of first array will be the Index of Third array
and the the Values of the Second array will be the Values of Third array


Thanks in Advanced!

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by baltazar
0

Use php function : array_combine ( array $keys , array $values )

So in this case it would be

$c = array();

$c = array_combine($a, $b);
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.