<?php $input = ['key1','value1','key2','value2']; //$output=['key1'=>'value1','key2'=>'value2']; $output=[]; do { $output[current($input)] = next($input); } while (next($input)); print_r($output);
You have javascript disabled. You will not be able to edit any code.