This question already has an answer here:
I have two arrays, one with the keys and the other with the values:
key_array = ['key1','key2','key3']
values_array = ['val1','val2','val3']
How do I iterate through them (their size will vary) to obtain this:
array('key1' => 'val1',
'key2' => 'val2',
'key3' => 'val3')
</div>