I want to merge two arrays where first array will be keys and second array will be values in result array.
$array1 =array('k1','k2');
$array2 =array('v1','v2');
output should be:
array(
'k1' => 'v1',
'k2' => 'v2',
)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the
array_combinefunction. This function uses one array for keys, and one array for values.You can use it as:
In your case it would be: